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.

  1. Needs to check that value is between 0 and 2dp.
  2. Ideally locale-aware (as ZVF is) to allow for locale specific formatting (thousands, decimal as comma/dot)
  3. Would also want to extend to allow/disallow negative values
  4. And provide optional upper/lower limits.

  5. Is the key, as I can do 3. and 4. with a chain.

Do I need regex?

© Stack Overflow or respective owner

Related posts about zend-framework

Related posts about validation