repl.txt (626B)
1 2 {{alias}}( x, n[, b] ) 3 Rounds a numeric value to the nearest number with `n` significant figures. 4 5 Parameters 6 ---------- 7 x: number 8 Input value. 9 10 n: integer 11 Number of significant figures. Must be greater than 0. 12 13 b: integer (optional) 14 Base. Must be greater than 0. Default: 10. 15 16 Returns 17 ------- 18 y: number 19 Rounded value. 20 21 Examples 22 -------- 23 > var y = {{alias}}( 3.14159, 3 ) 24 3.14 25 > y = {{alias}}( 3.14159, 1 ) 26 3.0 27 > y = {{alias}}( 12368.0, 2 ) 28 12000.0 29 > y = {{alias}}( 0.0313, 2, 2 ) 30 0.03125 31 32 See Also 33 -------- 34