input value
integer power
positive integer base
rounded value
// Round a value to 2 decimal places:
var v = roundb( 3.141592653589793, -2, 10 );
// returns 3.14
// If n = 0 or b = 1, `roundb` behaves like `round`:
var v = roundb( 3.141592653589793, 0, 2 );
// returns 3.0
// Round a value to the nearest multiple of two:
var v = roundb( 5.0, 1, 2 );
// returns 6.0
Rounds a numeric value to the nearest multiple of \(b^n\) on a linear scale.
Notes