Use Math.round(num * 100) / 100
Edit: to ensure things like 1.005 round correctly, we use
Math.round((num + Number.EPSILON) * 100) / 100
Use Math.round(num * 100) / 100
Edit: to ensure things like 1.005 round correctly, we use
Math.round((num + Number.EPSILON) * 100) / 100
For further actions, you may consider blocking this person and/or reporting abuse
Oscar -
Mahak Kaur -
Paweł Ludwiczak -
0x3d Site -
Top comments (0)