🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #6294

Re: format question

#6294
From: JD
Date: Tue, 24 May 2005 11:39
16 lines
1338 bytes
"Karim" <Karim@noemail.com> wrote:
>
>is there any API to convert a string or an int to a specific format? For example:
>my input: 12.3   output: 000012.3
>          345.9          000345.9

That can be accomplished using sprintf or AnsiString.sprintf:

    // assumes Buffer is a char* 
    sprintf( Buffer, "%06f", SomeFloat );

    // assumes Buffer is an AnsiString
    Buffer.sprintf("%06f", SomeFloat );

~ JD
Technical Details
Message-ID: <42931256$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!feeder.xsnews.nl!newsfeed.bit.nl!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <4292f5a8$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,3b7f7b4a56d80b10
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "JD" <nospam@nospam.com>
Sender: "JD" <nospam@nospam.com>
Reply-To: "JD" <nospam@nospam.com>
Subject: Re: format question
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 64.12.116.131     
X-Forwarded-For: 172.173.181.96
References:  <4292f5a8$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <42931256$1@newsgroups.borland.com>
Date: 24 May 2005 04:39:02 -0700
X-Trace: newsgroups.borland.com 1116934742 207.105.83.66 (24 May 2005 04:39:02 -0700)
Lines: 17
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!feeder.xsnews.nl!newsfeed.bit.nl!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail