Checks if a number has any decimals digits
%
) operator to check if the number is divisible by 1
and return the result.const hasDecimals = num => num % 1 !== 0;
hasDecimals(1); // false
hasDecimals(1.001); // true
JavaScript, Math
Implements the Luhn Algorithm, used to validate a variety of identification numbers.
JavaScript, Math
Converts a number to an array of digits, removing its sign if necessary.
JavaScript, Math
Formats a number using fixed-point notation, if it has decimals.