Package: decimal
Decimal number handling APIs.
API
Methods
fromString
function fromString(value as string) as decimal
Converts string values to decimal.
min
function min(value1 as decimal, value2 as decimal) as decimal
The minimum value between value1 and value2.
Since: 1.5.0
max
function max(value1 as decimal, value2 as decimal) as decimal
The maximum value between value1 and value2.
Since: 1.5.0
ceiling
function ceiling(value as decimal, precision as int) as decimal
Rounding mode to round towards positive infinity. If the result is positive, behaves as for roundUp
; if negative, behaves as for roundDown
.
Since: 1.6.0
floor
function floor(value as decimal, precision as int) as decimal
Rounding mode to round towards negative infinity. If the result is positive, behaves as for roundDown
; if negative, behaves as for roundUp
.
Since: 1.6.0
roundUp
function roundUp(value as decimal, precision as int) as decimal
Rounding mode to round towards "nearest neighbor" unless both neighbors are equidistant, in which case round up.
Since: 1.6.0
roundDown
function roundDown(value as decimal, precision as int) as decimal
Rounding mode to round towards "nearest neighbor" unless both neighbors are equidistant, in which case round down.
Since: 1.6.0
sum
function sum(value as list of decimal) as decimal
Returns the sum of all the elements in the list
random
function random(valmin as decimal, valmax as decimal, precision as int) as decimal
Returns a new random decimal between valmin and valmax with the precision specifiec. If precision is 0, 0 decimals will be used.
Since: 1.7.0
avg
function avg(values as list of decimal) as decimal
maxList
function maxList(values as list of decimal) as decimal
minList
function minList(values as list of decimal) as decimal
coalesce
function coalesce(value as decimal, defaultValue as decimal) as decimal
Since 1.5.1