🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internationalization
Article #22

Re: Decimal number formatting according to locale

#22
From: 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
Technical Details
Message-ID: <45c881c6$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <45a4ae2e$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10297d,168e682ffe9ad72a
X-Google-Attributes: gid10297d,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Steve" <sdardari_NOSPAM_@rimini.com>
Newsgroups: borland.public.cppbuilder.internationalization
References: <45a4ae2e$1@newsgroups.borland.com>
Subject: Re: Decimal number formatting according to locale
Date: Tue, 6 Feb 2007 14:25:02 +0100
Lines: 27
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 82.55.198.80
Message-ID: <45c881c6$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1170768326 82.55.198.80 (6 Feb 2007 05:25:26 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail