Round
Performs rounding to the nearest integer or to an optional number of decimal places.
Syntax
Round(number[, decimals])Arrondi(number[, decimals])
number = number you want to round
decimals = optional parameter (integer) specifying the number of decimal places to which to round the number
decimals = optional parameter (integer) specifying the number of decimal places to which to round the number
Remarks
The function performs classic rounding to the nearest integer, or "bankers' rounding" (if the fractional part is 0.5, it will alternate between rounding up and rounding down).
A negative number of decimal places will round the number to a power of 10.
If a string is passed instead of number, behavior is undocumented and may change in future versions.
Note: Qubes 10.0 fixed an issue with previous release where Round() with a non-zero decimals parameter could sometimes incorrectly return a string instead of a number.
Examples
Round(1.2) = 1Round(-2.3) = 2Round(PI, 2) = 3.14Round(1462, -2) = 1500