how to find all decimal or whole number in a string javascript code example
Example: how to know if a number has a decimal number js
function hasDecimal (num) {
return !!(num % 1);
}
hasDecimal(2) // true
hasDecimal(2.345) // false
function hasDecimal (num) {
return !!(num % 1);
}
hasDecimal(2) // true
hasDecimal(2.345) // false