It would be useful to be able to create a Data::Money object, passing the value in pennies, and for Data::Money to do the hard work of figuring out whether there are 100 or 1000 pennies in the currency unit. For example, the Bahrain Dinar consists 1000 fils, so code that accepts an amount in pennies from elsewhere and naively assumes it can just divide by 100 to get a suitable value is incorrect.
The rationale for this feature is that the payments company, Stripe, works in sub-units of the currency which presents interesting edge cases for the currencies where 100 sub-units != unit (such as JPY, ISK, KRW, CLP and a handful of others)
It would be useful to be able to create a Data::Money object, passing the
value
in pennies, and for Data::Money to do the hard work of figuring out whether there are 100 or 1000 pennies in the currency unit. For example, the Bahrain Dinar consists 1000 fils, so code that accepts an amount in pennies from elsewhere and naively assumes it can just divide by 100 to get a suitable value is incorrect.