Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Force number to show two decimal places (with rounding). Source:
var input = 4.537;
var result = parseFloat(Math.round(num3 * 100) / 100).toFixed(2); // 4.54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment