Skip to content

Instantly share code, notes, and snippets.

@Security2431
Created July 5, 2017 08:53
Show Gist options
  • Save Security2431/9cb56b7331496672810cbe001ca3919e to your computer and use it in GitHub Desktop.
Save Security2431/9cb56b7331496672810cbe001ca3919e to your computer and use it in GitHub Desktop.
Highlighting numbers
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