Examples
banshee/examples-collection/examples/basics/
calculation
Example: + - * / %, number.round and the point that joins texts, on the uptime of a Linux.
par banshee1 installation1 version
Publiée le 27 octobre 2026. First version in this collection.
Calculation
The operators of calculation and the point that joins texts, on the time since a Linux started: a number of days, and the same in words, "4 d 1 h".
How to read it
+ - * /as in school;%is the rest of a division:$seconds % 86400are the seconds left once the whole days are counted.*,/and%come before+and-; what is between parentheses comes first of all.number.round($n)rounds to a whole number,number.round($n, 2)keeps two decimals.- A text that is the writing of a number counts as that number in a calculation:
$words[0], read from the command, divides. - The point joins texts, a number counting as its digits. It takes a blank on each side:
$days . ' d ', never$days.' d '. - The point is under
+and-:'total ' . $a + $breads'total ' . ($a + $b).
To adapt it
**,+=,++do not exist: write$x * $x,$x = $x + 1.- The watch warns under 0.1 day, about two hours and a half after a restart.