RoundSigFigs
Use
The RoundSigFigs() function returns a number rounded to have the number signigicant figures specified. It will round the number up or down appropriately.
The number result given by RoundSigFigs() is a new number stored at that value, as opposed to rounding with value formatting, which only changes how a number is displayed.
RoundSigFigs() treats rounding up as rounding away from 0.
For example, RoundSigFigs(-7.9, 1) = -8 and
RoundSigFigs(-7.2, 1) = -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, RoundSigFigs(5.8ft, 1) and
RoundSigFigs(5.8 ft to mm, 1)
will return values that are not equal.
Examples
RoundSigFigs(23847, 1) = 20000RoundSigFigs(23847, 3) = 23800RoundSigFigs(.0002384, 2) = 0.00024RoundSigFigs(.0002384, 3) = 0.000238RoundSigFigs(1.8, 1) = 2RoundSigFigs(1.2, 1) = 1RoundSigFigs(-1.8, 1) = -2RoundSigFigs(12.8888, 3) = 12.9RoundSigFigs(12.8888, 5) = 12.889RoundSigFigs(45183.1, 3) = 45200RoundSigFigs(3.2 ft, 1) = 3ftRoundSigFigs(3.2 ft to cm, 1) = 98cmRoundSigFigs(3.2 ft to cm, 1) to ft = 3.215 ft
Related functions
| Function |
RoundSigFigs(value)
RoundSigFigs(value, figures)
|
RoundSigFigs is included by default in each file as part of the Math library.
See also: