Board index » cppbuilder » Changing Decimal separator from US to European format

Changing Decimal separator from US to European format


2005-08-19 11:50:21 PM
cppbuilder86
How do I change the Decimal Separator from '.' (US Format) to ',' European format in C++ Builder?
 
 

Re:Changing Decimal separator from US to European format

"Harsha Rao" < XXXX@XXXXX.COM >wrote in message
Quote
How do I change the Decimal Separator from '.'
(US Format) to ',' European format in C++ Builder?
There is a global DecimalSeparator variable available. Please read the VCL
documentation for more details.
But why would you want to change it?
Gambit
 

Re:Changing Decimal separator from US to European format

Hi,
Quote
How do I change the Decimal Separator from '.' (US Format) to ',' European format in C++ Builder?
as simple as it could be:
DecimalSeparator=',';
best regards
Michael
 

{smallsort}

Re:Changing Decimal separator from US to European format

Quote
But why would you want to change it?
I think that DecimalSeparator defines how the
decimal separator on NUM keyboard behaves...
--
Best regards,
Vladimir Stefanovic
 

Re:Changing Decimal separator from US to European format

Vladimir Stefanovic wrote:
Quote
I think that DecimalSeparator defines how the
decimal separator on NUM keyboard behaves...
No, DecimalSeparator defines how decimal values are written and parsed.
DecimalSeparator = ',';
AnsiString Str = 2.5;
Now Str will be "2,5". DecimalSeparator only affects the VCL and not
Standard Library and other libraries.
Ivan Johansen
 

Re:Changing Decimal separator from US to European format

"Harsha Rao" < XXXX@XXXXX.COM >writes:
[in addition to the response you already got]
Quote
How do I change the Decimal Separator from '.' (US Format) to ','
European format in C++ Builder?
The ISO C Standard has a function setlocale() ("inherited" in C++ as
std::setlocale()) that you can use to customize the way the C part of
the Standard Library deals with various things, including number
formatting.
In the Standard C++ Library, there is the locale facet std::numpunct
that you can use to customize how streams deal with number
punctuation.