Skip to content

Instantly share code, notes, and snippets.

@genert
Last active December 23, 2015 22:21
Show Gist options
  • Save genert/4faea93b4339c7a04b42 to your computer and use it in GitHub Desktop.
Save genert/4faea93b4339c7a04b42 to your computer and use it in GitHub Desktop.
Rounding. Example Round(3.44444) => "3.44"
function Round (n) {
return Number(`${Math.round(`${n}e${2}`)}e-${2}`).toString();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment