Numeric Formula Functions
Here are the formula functions that you can use to manipulate numeric data:
ABS(n)
Returns the magnitude of a numeric operand n
as a positive numeric value. If the value
of the operand is positive, its value returns unchanged. If the operand
is negative, then the value's sign inverts and the value returns as
a positive number.
Example:
ABS (-17)
It returns 17.
FLOOR(n)
Returns the integer part of a numeric operand n
. If the value of the operand contains information
after the decimal point, FLOOR
discards
that information and returns a whole number.
Example:
FLOOR(35.455)
It returns 35.
GREATEST(n, n [, n] ...) or GREATEST_OF(n, n [, n] ...)
Compares all the operands and returns the greatest value.
LEAST(n, n [, n] ...) or LEAST_OF(n, n [, n] ...)
Compares all the operands and returns the smallest value.
MOD(m, n)
Returns the remainder after dividing m
by n
.
POWER(m, n)
Returns m
raised to
the n
th power.
ROUND(m [,n])
Rounds m
to n
decimal places. The default number of decimal
places is 0.
Examples:
ROUND(2.3401, 2)
It returns 2.34.
ROUND (2.3461, 2)
It returns 2.35.
ROUNDUP(m [,n]) or ROUND_UP(m [,n])
Rounds off m
up to n
decimal places. The default number of places
is 0.
Examples:
ROUND_UP(2.3401, 2)
It returns 2.35.
ROUND_UP(2.3400, 2)
It returns 2.34.
TRUNC(n [,m]) or TRUNCATE(n [,m])
Truncates m
down to n
decimal places. The default number of places
is 0.
Examples:
TRUNC(2.3401, 2)
It returns 2.34.