Zend framework currency validation
Posted
by Dan
on Stack Overflow
See other posts from Stack Overflow
or by Dan
Published on 2010-05-19T16:26:45Z
Indexed on
2010/05/19
16:30 UTC
Read the original article
Hit count: 391
How can I validate (a form element in this case) to ensure that the value is a currency?
Have looked at Zend_Validate_Float.
- Needs to check that value is between 0 and 2dp.
- Ideally locale-aware (as ZVF is) to allow for locale specific formatting (thousands, decimal as comma/dot)
- Would also want to extend to allow/disallow negative values
And provide optional upper/lower limits.
Is the key, as I can do 3. and 4. with a chain.
Do I need regex?
© Stack Overflow or respective owner