Possible Duplicate:
Round number up to the nearest multiple of 3
I need a javascript call that will round numbers up to the nearest multiple of 12.
Some examples:
1 -> 12
7 -> 12
14 -> 24
27 -> 36
Does anyone know of a good method for doing this? All I can think of is “If between 1-11, make it 12. If between 13-23, make it 24, etc.” But that doesn’t seem very efficient.
Use
Math.ceil()