Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to check if a number is float javascript

function isInt(n){
    return Number(n) === n && n % 1 === 0;
}

function isFloat(n){
    return Number(n) === n && n % 1 !== 0;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #number #float #javascript
ADD COMMENT
Topic
Name
3+6 =