comp.lang.ada
 help / color / mirror / Atom feed
From: mfeldman@seas.gwu.edu
Subject: Re: Number into String
Date: 2000/01/06
Date: 2000-01-06T15:59:12+00:00	[thread overview]
Message-ID: <852e4g$1s9$1@news.netmar.com> (raw)

In a previous article,  Robert A Duff  <bobduff@world.std.com> writes:
>"Jeong, Lae Hyung" <lovelace@dreamwiz.com> writes:
>
>> How can I convert float number into String ?
>
>Use the Float'Image attribute.
>
>- Bob

This is correct but a bit oversimplified. Float'Image returns a string
giving the Float value in "E-notation", and provides no way for the
programmer to specify other formats.

Instead, look up the details of Ada.Float_Text_IO.Put (in RM A.10). 
There are three kinds of Put: to Standard_Output, to a named file,
and to a string. This last form seems to be little known, but is very
handy, because you can use all the formatting parameters: Fore, Aft,
Exp, etc. 

There are Get-from-string and Put-to-string forms in all the various
Ada.Text_IO packages. They are very useful in parsing input and
formatting output!

Mike Feldman


     -----  Posted via NewsOne.Net: Free Usenet News via the Web  -----
     -----  http://newsone.net/ --  Discussions on every subject. -----
   NewsOne.Net prohibits users from posting spam.  If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net




             reply	other threads:[~2000-01-06  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-06  0:00 mfeldman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-01-06  0:00 Number into String Jeong, Lae Hyung
2000-01-06  0:00 ` Jeong, Lae Hyung
2000-01-06  0:00   ` reason67
2000-01-06  0:00     ` Robert Dewar
2000-01-06  0:00       ` reason67
2000-01-06  0:00         ` James S. Rogers
2000-01-06  0:00   ` Robert Dewar
2000-01-06  0:00 ` Richard D Riehle
2000-01-06  0:00 ` Jeong, Lae Hyung
2000-01-06  0:00   ` Robert A Duff
2000-01-06  0:00 ` David C. Hoos, Sr.
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox