comp.lang.ada
 help / color / mirror / Atom feed
From: Marin David Condic <condicma@bogon.pwfl.com>
Subject: Re: Float to string conversion
Date: 1999/03/18
Date: 1999-03-18T00:00:00+00:00	[thread overview]
Message-ID: <36F16AC3.696C40AE@pwfl.com> (raw)
In-Reply-To: 7crnh9$773$1@nnrp1.dejanews.com

dd5372@my-dejanews.com wrote:
> 
> I'm using Rapid to build a GUI interface for a simple demo program and need to
> be able to convert float values to strings.  Using the 'image property is okay
> for integers, but using it on floats gives me the default Ada scientific
> notation for floats.  Any suggestions?
> 
You'll want to investigate Ada.Text_IO.Float_IO and look at the "Put"
procedures. One of them looks kind of like this:

procedure Put (
    To   : out String ;
    Item : in Num ;
    Aft  : in Field := Default_Aft ;
    Exp  : in Field := Default_Exp) ;

See also ARM A.10.9 for more details

Note that you get a pre-instantiated version of this package called
Ada.Float_Text_IO (ARM A.10.9{32..34}) for the standard type Float. That
makes the job just a little easier.

MDC

-- 
Marin David Condic
Real Time & Embedded Systems, Propulsion Systems Analysis
United Technologies, Pratt & Whitney, Large Military Engines
M/S 731-95, P.O.B. 109600, West Palm Beach, FL, 33410-9600
***To reply, remove "bogon" from the domain name.***




  reply	other threads:[~1999-03-18  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-18  0:00 Float to string conversion dd5372
1999-03-18  0:00 ` Marin David Condic [this message]
1999-03-18  0:00 ` John Herro
replies disabled

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