This regexp should do it: '/^[0-9]+(\.?[0-9]+)?$/'

But you should probably just use is_numeric()

On Mar 10, 5:19 am, Eleazar <[email protected]> wrote:
> Hi, sorry to ask, still struggling with this...
> is it possible to allow integer numbers and decimals on the decimal
> validation rule?
>
> thanks
>
> On Mar 8, 7:19 pm, Eleazar <[email protected]> wrote:
>
> > Hi all,
> > I'm not sure if it's possible or if I have to write my own regex, but
> > my input data fails on the decimal validation when I enter a whole
> > value such as 100. I would like to accept integer values but also
> > floats eg. 100, 100.0, 100.1, 100.2 etc. I couldn't see any way to do
> > this without my own regex but I thought I might have missed something.
>
> > Thanks for your time.
>
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to