[EMAIL PROTECTED] (William R. Ward) writes:

> I need your help in debugging this problem.  It works fine on my
> machine, but the problem with locale-related code is that it behaves
> differently depending on where you are.  The locale test script
> contains the following code:
> 
> if (setlocale(POSIX::LC_ALL, "de_DE"))
> {
>     my $german = new Number::Format();
>     print "not "
>       unless ($german->format_price(123456.789) eq 'DEM 123.456,79');
> }
> print "ok 2\n";
> 
> setlocale(POSIX::LC_ALL, "en_US");
> my $english = new Number::Format();
> print "not " unless ($english->format_price(123456.789) eq 'USD 123,456.79');
> print "ok 3\n";
> 
> If you can modify this script on your machine to print the values
> being returned by format_price, and send the output back to me, I
> would greatly appreciate it.  Thanks!
> 
> --Bill.

I changed the important part to:

-------------
if (setlocale(POSIX::LC_ALL, "de_DE"))
{
    my $german = new Number::Format();
    print "not "
        unless ( $german->format_price(123456.789) eq 'DEM 123.456,79');

$out = $german->format_price(123456.789);
print $out, "\n\n";
}
print "ok 2\n";
------------------

And I got:
DEM 123.456.,79


Defintly a bug somewhere. The rounding is correct but the function
seems to hate 3 ciphers after the "." .

Hope that helps,

Andreas Marcel



Reply via email to