You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
programming-examples/js/Math/Check if a number is a whol...

13 lines
333 B
JavaScript

function number_test(n)
{
var result = (n - Math.floor(n)) !== 0;
if (result)
return 'Number has a decimal place.';
else
return 'It is a whole number.';
}
console.log(number_test(25.66));
console.log(number_test(10));