Link to home
Start Free TrialLog in
Avatar of olka
olkaFlag for Germany

asked on

Setting Decimal and Thousand Character in my App

Hi folks,
i want to have only one output for numbers in my application. The Settings which are coming from the control panel for these characters should be ignored.

I can read it with GetLocaleInfo, but I can't set it with SetLocaleInfo. But when i format a number these changes have no effect. The number is displayed the same way.
Does anybody know how to change the current characters for the decimal and thousand character.

olka
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Yes, simply "escape" the format:

FORMAT(100.4, " #0\,000") will produce this output:
100,400
independant of the regional settings. The backslash will make the , to be forced, and not interpreted using the regional settings

Cheers
Avatar of olka

ASKER

thank you,
but now i have the problem with great number
try:
format(23412956.67, "#\.##0\,00")  => output is 234.129,57

but i want 23.412.956,67
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It's a bit of a pain that you can't escape a decimal point and still get the format function to understand it as a d.p.
You're best off writing your own little routine to do this - having the added advantage of providing a single point to change if you need to extend it to do different formats.