Locale number formatting
Posted: 28.11.2006, 14:03
Hi everyone,
I'm having problems with the function to_char in a query on postgresql 8.1.5 and Delphi 7 Pro.
There's this function in my query:
"trim(to_char(impo, '9G999G999G990D99'))"
this should return a number with locale (Italian) settings and works fine if I try this at designtime, but when I use it at runtime it puts a wrong thousand separator (a ",") while the decimal separator is right (always a ",").
ex:
Designtime trim(to_char(5432.66, '9G999G999G990D99'))
returns "5.432,66"
Runtime trim(to_char(5432.66, '9G999G999G990D99'))
returns "5,432,66"
I tried resetting the properties DecimalSeparator and ThousandSeparator right before opening the query but nothing changes.
Any clue?
Thanks,
Daniele
I'm having problems with the function to_char in a query on postgresql 8.1.5 and Delphi 7 Pro.
There's this function in my query:
"trim(to_char(impo, '9G999G999G990D99'))"
this should return a number with locale (Italian) settings and works fine if I try this at designtime, but when I use it at runtime it puts a wrong thousand separator (a ",") while the decimal separator is right (always a ",").
ex:
Designtime trim(to_char(5432.66, '9G999G999G990D99'))
returns "5.432,66"
Runtime trim(to_char(5432.66, '9G999G999G990D99'))
returns "5,432,66"
I tried resetting the properties DecimalSeparator and ThousandSeparator right before opening the query but nothing changes.
Any clue?
Thanks,
Daniele