doo.functions.math
Basic mathematical functions that can also be used in a Calculated field type.
Round
Mathematically round a decimal number to specified number of decimal places (solves JavaScript rounding inaccuracy). E.g. round(2.494, 2) = 2.49, round(2.495, 2) = 2.5, round(1.006, 2) = 1.01, round(1.015, 2) = 1.02, round(1.045, 2) = 1.05
Example
ROUND(2.494, 2) => 2.49
MIN
Returns the lowest number.
Example
MIN(-50, 0, 20) => -50
MAX
Returns the largest number.
Example
MAX(-50, 0, 20) => 20
AVG
Returns the average.
Example
AVG(-50, 0, 20) => -10
ABS
Return the absolute value.
Example
ABS(-52) => 52
ROUNDUP
Returns number rounded up.
Example
ROUNDUP(2.44, 1) => 2.5
ROUNDDOWN
Returns number rounded down.
Example
ROUNDDOWN(2.44, 1) => 2.4
PERCENTAGE
Numerator/Denominator * 100, Parameters 10, 50 gives 20 (percents)
Example
PERCENTAGE(10, 50) => 20