How to round to at most 2 decimal places, if necessary?
Use Math.round() : Or to be more specific and to ensure things like 1.005 round correctly, use Number.EPSILON :
Use Math.round() : Or to be more specific and to ensure things like 1.005 round correctly, use Number.EPSILON :
Use Math.round() : Or to be more specific and to ensure things like 1.005 round correctly, use Number.EPSILON :