Skip to content

Instantly share code, notes, and snippets.

@fatihacet
Created October 30, 2011 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fatihacet/1326516 to your computer and use it in GitHub Desktop.
Save fatihacet/1326516 to your computer and use it in GitHub Desktop.
Convert number to nearest 10x digit
// Divide by 10 and round it, then multiply by 10.
var x = 136;
console.log(Math.round(x / 10) * 10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment