Created
November 10, 2016 09:21
-
-
Save xbotter/65395317111d7a3e92854e2ac779396b to your computer and use it in GitHub Desktop.
Fload.Round
This file contains 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
// define round | |
function round(float,precision) { | |
return Math.round(float/precision)/(1/precision); | |
} | |
// how to use | |
round(0.3-0.2, .001) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment