Created
January 29, 2017 14:31
-
-
Save sbob909/3ae65105194dbe808cabe88c72bacf31 to your computer and use it in GitHub Desktop.
JavaScript rounding helper
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
// helper to round values without rounding errors | |
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