Last active
May 9, 2018 09:40
-
-
Save c7x43t/ea3f9250457c678e3e42a87f4f7aab04 to your computer and use it in GitHub Desktop.
roundN(1.005,2) -> 1.01
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 roundN(n,m){ | |
return Math.round(n*Math.pow(10,m)+72e-16)/Math.pow(10,m); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment