Skip Menu |

This queue is for tickets about the Form-Sensible CPAN distribution.

Report information
The Basics
Id: 63988
Status: resolved
Priority: 0/
Queue: Form-Sensible

People
Owner: Nobody in particular
Requestors: LGODDARD [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in:
  • 0.10000
  • 0.11000
  • 0.11001
  • 0.11002
  • 0.11003
  • 0.11100
  • 0.11101
  • 0.11102
  • 0.11103
  • 0.11200
  • 0.11201
  • 0.11202
  • 0.11210
  • 0.11211
  • 0.11220
  • 0.11221
  • 0.11222
  • 0.20001
  • 0.20002
Fixed in: (no value)



Subject: Feature request: Field::Number code
Could Field::Number be allowed to accept a 'code' ref as does Field::String? Then I could validate currency - or maybe a ::Field::Currency class (in which case I should maybe point out not all currency has a decimal point)? tia lee
Field::Number can already accept a code ref for validation purposes. All fields can take both a regex and a code ref in the validation hash. In the most recent release - 0.20010 - the default Number regex can be overridden by the 'regex' element of the validation hash. This allows you to bypass the default decimal number regex check and replace it with whatever you like. Please note, however, that this will not make the other Numeric validations (minimum / maximum / step) function on unusually formatted numbers as they require the value to be something Perl can parse as a number. Jay On Thu Dec 16 10:41:29 2010, LGODDARD wrote: Show quoted text
> Could Field::Number be allowed to accept a 'code' ref as does > Field::String? Then I could validate currency - or maybe a > ::Field::Currency class (in which case I should maybe point out not all > currency has a decimal point)? > > tia > lee