RoundToSigFigs ( number ; sigfigs )
Rounds a number to the specified number of significant figures.
Average rating: 4.7 (31 votes) Log in to vote
1234 ; 2
1234 ; 3
0.0009876 ; 1
0.0009876 ; 2
0.0009876 ; 3
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
Rounds a number to the specified number of significant figures. Uses a log base ten to gauge the order of magnitude for "number" and uses that to figure out which decimal place is the rounding point. Then it uses filemaker's built in rounding function to round to that point. For > .5, this function rounds up.
Henry Olders, Montreal
Dec 1, 2015
because the log function only works with positive numbers, use
Round ( number ; sigfigs - 1 - Floor ( Log ( Abs ( number ) ) ) )
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.