Created
August 22, 2017 19:37
-
-
Save feload/57aea05ecfe12354b9b879e2e45059f3 to your computer and use it in GitHub Desktop.
Round JS function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function round(value, decimals) { | |
return Number(Math.round(value+'e'+decimals)+'e-'+decimals); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment