You need to first check if it’s a number. If so you can use the Math. Round method . If the result and the original value are equal then it’s an integer.
Is integer check in Java?
You need to first check if it’s a number. If so you can use the Math. Round method . If the result and the original value are equal then it’s an integer.