comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org>
Subject: Re: Formatting output
Date: Thu, 15 Nov 2001 13:09:12 -0500
Date: 2001-11-15T18:09:14+00:00	[thread overview]
Message-ID: <9t10ca$5u8$1@nh.pace.co.uk> (raw)
In-Reply-To: bf8dbe70.0111150932.536dad02@posting.google.com

Well, to suggest a possible solution to the problem of getting a floating
point number represented as currency in either a string or in output to a
text file, you'll have to be a bit more specific as to what constraints you
want to put on it.

Ada.Text_IO.Float_IO is one means of doing it, but if you're going to rule
that out, there aren't a lot of alternatives. You could potentially convert
the value to a decimal fixed and use either the appendix I cited elsewhere
or you're right back to Ada.Text_IO... subpackages. Or you can totally
Roll-Your-Own by doing math ops on the number to get individual digits and
convert the digits to characters & build your own string out of it.

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/


"Ben" <cptnben@gisco.net> wrote in message
news:bf8dbe70.0111150932.536dad02@posting.google.com...
> I should also correct my post by saying that FLOAT_IO is not used at
> all in my current code.






      reply	other threads:[~2001-11-15 18:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-14 21:58 Formatting output Ben
2001-11-14 22:14 ` Stephen Leake
2001-11-14 22:26   ` Marin David Condic
2001-11-15 17:32   ` Ben
2001-11-15 18:09     ` Marin David Condic [this message]
replies disabled

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