Subject: | Does not honour FRAC_DIGITS like math::currency |
Some currencies (eg japanese yen) have a non-hundredth currency subunit, however Data::Money assumes that frac_unit is always two.
e.g. as_float, while saying it has been jacked from math::currency, has a hardcoded
bfround(-2) (math::currency uses the locale frac_unit). So BHD, KWD etc lose the ability to
have three decimal places, and yen always have decimal places added even though there are
no subunits of yen (rin and sen were removed in 1953)
my $dm = Data::Money->new( value => '1.234', code => 'JPY' );
is( $dm->as_float, '1', 'yen have no subunits' );
fails when it should pass.
Similarly,
my $dm = Data::Money->new( value => '1.234', code => 'BHD' );
is( $dm->as_float, '1.234', 'Bahraini Dinar have one thousand fils' );