> 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
> 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
I think that DecimalSeparator defines how the
decimal separator on NUM keyboard behaves...
--
Best regards,
Vladimir Stefanovic
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
[in addition to the response you already got]
> 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.