Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript how to say if a number is a whole number?

Using modulus will work:

num % 1 != 0
// 23 % 1 = 0
// 23.5 % 1 = 0.5
 
PREVIOUS NEXT
Tagged: #javascript #number
ADD COMMENT
Topic
Name
9+3 =