Created
August 5, 2014 17:43
-
-
Save jrgleason/2fd0d73adca30bb349f8 to your computer and use it in GitHub Desktop.
Round negative decimal in Javascript
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
scope.roundETD = function(etd){ | |
var start = (etd - scope.currentDate.now())/360000; | |
var fixed = start.toFixed(3); | |
var rounded = Math.round(fixed) | |
return Number(rounded+"e-1"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment