locale specific (easy question to answer)

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

locale specific (easy question to answer)

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:44 pm

by overseas >> Wed, 15 Dec 2004 21:32:21 GMT

Hello All

I've had this question pop up on my desk from belgium...i havent experienced it as i only have one locale loaded up so...

code:

addTax() : Decimal;

constants
TaxRate = 0.125
begin
return self + self * TaxRate;
end;

-----

testAddTax();

vars
d : Decimal[8, 2];
begin
d := 100;

write 12.5/100;
write (12.5/100).Decimal;
write d*(0.125);
write d*(0.125).Decimal;
write d + d*(0.125);
write d.addTax();
end;
-----
Situation:
OS: Windows 2000 Advanced Server UK
1)Regional settings: Dutch Belgium (decimal symbol: ',' digit grouping symbol: '.')
Locale in jade: Dutch Belgium
2)Regional settings: English (New Zealand) (decimal:'.' digit ',')

output 1:
0,125
0
0.00
0.00
100.00
100.00

output 2:
0.125
0.125
12.50000
12.50000
112.50000
100.00

Any reasons why the locale changes the answers?
What is the procedure to correct it.

Cheers people

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 34 guests