|
Ace Dynamic Comp Index
June 2020
Niagara-4.9
|
Rounds a float to nearest n places. Uses the tie-breaker rule that positive number are rounded up if a tie-break situation exists, and negative numbers are rounded down ("more negative") if a tie-break situation exists.
Example: 123.456 with n = 0 : rounds to 123.000
with n = 1 : rounds to 123.500 with n = -1: rounds to 120.000
Example: -123.456 with n = 0 : rounds to -123.000
with n = 1 : rounds to -123.500 with n = -1: rounds to -120.000
Positive numbers: 1) multiply by 10^n 2) add 0.5 and truncate (convert to integer) 3) divide by 10^n
Negative numbers: 1) multiply by 10^n 2) subtract 0.5 and truncate (convert to integer) 3) divide by 10^n
where n = number of decimal places to round
out = round(in)
Facets: @precision = 3 @readonly @summary
Facets: @input @precision = 3 @summary
Default: 0
Facets: @config @max = 3 @min = -1
1.8.15