Subject: | format_price() incorrect. |
Date: | Mon, 19 Jan 2009 10:53:03 +0100 |
To: | bug-Number-Format [...] rt.cpan.org |
From: | David Raab <d.raab [...] angel.de> |
Hi,
format_price() is Incorrect.
Show quoted text
> my @prices = ( 1234, 56, 75.2345, 12578.5 );
>
> my $nf = Number::Format->new(
> THOUSANDS_SEP => q{.},
> DECIMAL_POINT => q{,},
> INT_CURR_SYMBOL => q{€},
> DECIMAL_DIGITS => 2,
> DECIMAL_FILL => 1,
> );
>
> for my $price ( @prices ) {
> print $nf->format_price($price, 2), "\n";
> }
This prints out:
Show quoted text> €1.234,00
> €56,00.00
> €75,23.00
> €12.578,50
The first and the last are correct but the second and the third are
incorrect.
It should be:
Show quoted text> €1.234,00
> €56,00
> €75,23
> €12.578,00