MSDotNetBuddy
The blog is to experiment with various technologies.
Search This Blog
2023/07/25
Check number is integer or not
var
num
=
23.678
if
(
num
==
Math
.
floor
(
num
)){
console
.
log
(
"Integer"
)
}
else
{
console
.
log
(
"Not An Integer"
)
}
if
(
num
==
Math
.
ceil
(
num
)){
console
.
log
(
"Integer"
)
}
else
{
console
.
log
(
"Not An Integer"
)
}
output:
Integer Integer
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment