Page 1 of 1
Check for decimal points
Posted: Mon Aug 06, 2007 6:29 am
by aceconcepts
Hi,
How would i check to see if any decimal points exist in a 'posted' field value?
i.e.
98.0 = Bad
90.8 = Bad
90 = Good
Posted: Mon Aug 06, 2007 7:01 am
by feyd
Posted: Mon Aug 06, 2007 7:36 am
by aceconcepts
Thanks for the reply.
I was hoping to output an error message if a decimal value was found.
Basically I only want users to be able to enter a 3 digit number into a form field and prevent any other values being input i.e. only numbers like ("455" or "635") NOT "54.0".
Hope this makes sense.
Posted: Mon Aug 06, 2007 7:42 am
by feyd
Compare the result from
intval() with the original.
Posted: Mon Aug 06, 2007 7:51 am
by aceconcepts
Ahhh what a good idea.
Thanks.