Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Decimal number formatting according to locale

6 views
Skip to first unread message

ilti...@attglobal.net

unread,
Jan 10, 2007, 4:12:17 AM1/10/07
to
Trying to use IntToStr() to convert an integer into an AnsiString.
Although the ThousandSeparator is set to',' the generated string does not
contain it.
For example, the number 44444 is converted to: "44444" while we wish it to
be converted to: "44,444".

What am I doing wrong? Should another function be used?

Thanks, Ronit.


Steve

unread,
Feb 6, 2007, 8:25:02 AM2/6/07
to
Hi Ronit,

<ilti...@attglobal.net> ha scritto nel messaggio
news:45a4ae2e$1...@newsgroups.borland.com...

For this purpose I use the Format function, like this :

String s = Format ("%.0n",ARRAYOFCONST(((float)num)));

where num is the number to be print in the string. This print the correct
decimal and thousand separators, it work for me, but I've not tested with
ThousandSeparator is set to',' ... pheraps I think can work ... try it.

Hope this can help.

Steve


0 new messages