🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internationalization
2 messages
2 total messages Started by iltit119 Wed, 10 Jan 2007 09:12
Decimal number formatting according to locale
#16
Author: iltit119
Date: Wed, 10 Jan 2007 09:12
9 lines
1129 bytes
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.
Re: Decimal number formatting according to locale
#22
Author: Steve
Date: Tue, 06 Feb 2007 13:25
25 lines
1792 bytes
Hi Ronit,

<iltit119@attglobal.net> ha scritto nel messaggio 
news:45a4ae2e$1@newsgroups.borland.com...
> 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.

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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads