RoundDown
Function |
RoundDown(value)
RoundDown(value, digits)
|
Use
The RoundDown() function returns a number rounded down to a given decimal point. If nothing is provided for the decimal point, 0 is assumed.
The number result given by RoundDown() is a new number stored at that value, as opposed to rounding with value formatting, which only changes how a number is displayed.
RoundDown() treats rounding down as rounding towards 0.
For example, RoundDown(-7.8) = -7
.
Units
Numbers with units will be rounded based on those units. This means that the unit a number has at the point of calculation will affect the answer.
For example, RoundDown(5.8ft)
and RoundDown(5.8 ft to mm)
will return values that are not equal.
Examples
RoundDown(1.8) = 1
RoundDown(1.2) = 1
RoundDown(-1.8) = -1
RoundDown(1.8888, 2) = 1.88
RoundDown(1.8888, 3) = 1.888
RoundDown(45183.1, -2) = 45100
RoundDown(3.2 ft) = 3ft
RoundDown(3.2 ft to cm) = 97cm
RoundDown(3.2 ft to cm) to ft = 3.182 ft
Related functions
RoundDown is included by default in each file as part of the Math library.
See also: