Created
September 11, 2014 09:52
-
-
Save alexkilgour/b6d22d767cbb4c452890 to your computer and use it in GitHub Desktop.
Rounding a number down to a specified number of decimal places
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
// rounding down to specified decimal places | |
var round = function(value, decimals) { | |
return Math.floor(value * Math.pow(10,decimals)) / Math.pow(10,decimals); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment