UseΒ Math.round(num * 100) / 100
Math.round(num * 100) / 100
Edit:Β to ensure things like 1.005 round correctly, we use
Math.round((num + Number.EPSILON) * 100) / 100
Your email address will not be published. Required fields are marked *
Name*
Email*
Website