There are two different angles on this. For example, 1.0 is a decimal number. If you store it in a floating-point variable such as double, there would be no way to distinguish it from a floating-point variable containing the number 1 alone.
If you want to tell those apart, you'd have to do it earlier in the process, for example by capturing the value as a string and searching for the decimal point '.' character.
That's one aspect.
The other aspect is a number such as 3.14. That is also a decimal number. You might perhaps find the whole number part by casting or assigning it to a suitable integer type. Then test to see whether the result is equal to the original value. (This should work in practice though it is potentially less robust than using the library function).