Round a number to the nearest multiple of an arbitrary base. Does not round when the base is set to zero.
Any number to round
Any base to round to
n rounded to the nearest multiple of base
n
base
const y = SMath.round2(Math.PI, 0.2); // 3.2 Copy
const y = SMath.round2(Math.PI, 0.2); // 3.2
Round a number to the nearest multiple of an arbitrary base. Does not round when the base is set to zero.