comp.lang.ada
 help / color / mirror / Atom feed
From: "David Peterson" <dp@nospam.com>
Subject: altering number of significant figures
Date: Tue, 28 Sep 2004 15:59:01 +1000
Date: 2004-09-28T15:59:01+10:00	[thread overview]
Message-ID: <4158fd82@dnews.tpgi.com.au> (raw)

Hi, sorry for this stupid question, but i can not seem to find out how to do 
it. Suppose i define:


   myfloat : float := 1234.5678;
   screen_display("value = " & float'image(myfloat));


... where screen_display() prints out the content passed to it, to standard 
output.

However I do not know how to only print only the first 2 (for example) 
decimal places of myfloat.

The above will print "value = 1234.5678". However I want "value = 1234.56".

I know there is a simple solution to this, but i cant find it. Using Barnes 
to learn from.

Any help most welcome :)
Thanks,
David 





             reply	other threads:[~2004-09-28  5:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-28  5:59 David Peterson [this message]
2004-09-28  6:41 ` altering number of significant figures tmoran
2004-09-28  6:51 ` Martin Krischik
2004-09-28 17:58 ` Jeffrey Carter
  -- strict thread matches above, loose matches on Subject: below --
2004-09-28  6:52 Christoph Karl Walter Grein
2004-09-28 10:26 ` David Peterson
replies disabled

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