Andreas Marcel Riechert writes:
>[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,
That is very peculiar. Can you send me your "perl -V" output, and
also try running it with a few different values, such as:
123.4
1234.56
--Bill.
--
William R Ward - [EMAIL PROTECTED] Bay View Consulting Services
http://www.bayview.com/~wrw/ 2860 Porter St PMB 408
phone +1 831/479-4072 Soquel, CA 95073-2419 USA
PGP Key 0x2BD331E5; public key at http://www.bayview.com/~wrw/pubkey.txt