Another solution would be:

numberOfCoins# = 6 // Or whatever number the user entered

amount# = numberOfCoins# * 0.20 // The total amount in 'p', which is 6 * 0.2, or 1.2 in this case

IF INTEGER(amount) = amount THEN

// Valid value entered

ENDIF

So, with the above numbers, INTEGER(1.2) = 1.2 is FALSE since INTEGER(1.2) = 1.

But if numberOfCoins is say 10 then INTEGER(2.0) = 2.0 is TRUE since INTEGER(2.0) = 2.

Of course the modulus operator would work also, as you found out.

In the above code, I could have also said: (FMOD works with floating point numbers)

IF FMOD(amount, 1.0) = 0 THEN ... // We have a full dollar/pound/Euro amount

This checks to see if any pennies (or pence?) are remaining from a value.