Created
July 5, 2017 08:53
-
-
Save Security2431/9cb56b7331496672810cbe001ca3919e to your computer and use it in GitHub Desktop.
Highlighting numbers
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
var changeColorCell = function (number) { | |
var negativeNumClass = ".negative", | |
positiveNumClass = ".positive"; | |
if (Object.is(Math.sign(parseFloat(number)), -0)) { | |
return negativeNumClass; | |
} else if (Object.is(Math.sign(parseFloat(number)), 0)) { | |
return positiveNumClass; | |
} else if (Object.is(Math.sign(parseFloat(number)), 1)) { | |
return positiveNumClass; | |
} else if (Object.is(Math.sign(parseFloat(number)), -1)) { | |
return negativeNumClass; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment