Data::Currency?

jk2addict on 2007-02-08T19:01:06

Handel has Handel::Currency, which takes care of exposing formatting/conversion using the various Locale::Currency/Format things, as well as Finance::Currency::Convert::WebserviceX (or any other conversion class you want to glue in).

Handel and Mango expose H::C objects from when inflating/deflating certain columns in the DB schema, columns like price, subtotal, total, etc.

This stuff is generic enough that I feel the urge to split it out into CPAN stuffs. Much like DBICs InflateColumn::DateTime component that auto inflates data/time fields from the DB, I want to create an InflateColumn::Currency component to do the same. That's the easy part really.

The other half is that having IC::Currency require Handel just for Handel::Currency is silly, so it needs split out into its own CPAN module.

The question is, what should it be called? The only thing that stands out to me is Data::Currency, just like we have Data::UUID, Data::Integer etc. Does that sound sane?

I know we have a Math::Currency, but that's just a little shy of my needs, but it does have some good knowledge about currency math issues. At some point, Data::Currency should subclass it, or at least use/learn from it.

Thoughts?


I concur

Alias on 2007-02-09T00:50:44

Plan approved.

Attack at once.

Re:I concur

jk2addict on 2007-02-09T03:22:28

Bombs away! Should be on CPAN shortly, with tests even.

---------------------------- ------ ------ ------ ------ ------ ------ ------
File                           stmt   bran   cond    sub    pod   time  total
---------------------------- ------ ------ ------ ------ ------ ------ ------
blib/lib/Data/Currency.pm     100.0  100.0  100.0  100.0  100.0  100.0  100.0
Total                         100.0  100.0  100.0  100.0  100.0  100.0  100.0
---------------------------- ------ ------ ------ ------ ------ ------ ------

Finance::Currency

jdavidb on 2007-02-09T15:28:47

Might be a more specific namespace, since everything is Data.