Skip to content

Instantly share code, notes, and snippets.

@xbotter
Created November 10, 2016 09:21
Show Gist options
  • Save xbotter/65395317111d7a3e92854e2ac779396b to your computer and use it in GitHub Desktop.
Save xbotter/65395317111d7a3e92854e2ac779396b to your computer and use it in GitHub Desktop.
Fload.Round
// 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