[html-formfu] Deflator/Inflator::FormatNumber

onken at houseofdesign.de onken at houseofdesign.de
Wed Dec 17 11:08:58 GMT 2008


On Wed, 17 Dec 2008 11:01:35 +0000, "Carl Franks" <fireartist at gmail.com>
wrote:
> 2008/12/17  <onken at houseofdesign.de>:
>>
>> Hi Carl (and everyone else :-) ),
>>
>> I wrote a deflator/inflator couple for Number::Format.
>> The locale can be specified as well as precision and trailing zeroes.
>>
>> I'd be glad if you would have a look at it and consider to add it to
>> FormFu. The only disadvantage is that Number::Format fails on some
>> systems.
>> But I already contacted the author and send him a patch for the failing
>> tests.
> 
> It looks good.
> Though, would it make sense to try and pull the locale from
> $form->languages(), or at least provide a $form->locale() method you
> can get it from, so it doesn't have to be set in multiple places?
> Other than that, though - nice idea.


$form->locale() would be great, we could tweak DateTime to use it as well.
When I tested this module I recognized that the only locale I had installed
was en_US. After installing locales-all I had all of them.
Since $form->languages defaults to ['en'] I don't know if this is the best
approach.

moritz



More information about the HTML-FormFu mailing list