comp.lang.ada
 help / color / mirror / Atom feed
* Help: Truncating Decimal Types
@ 1997-12-30  0:00 John J. Cupak Jr.
  1997-12-30  0:00 ` Robert Dewar
  0 siblings, 1 reply; 4+ messages in thread
From: John J. Cupak Jr. @ 1997-12-30  0:00 UTC (permalink / raw)



A student tried to extract the integer portion of a decimal (money)
value using Money_Type'Truncation(Cash), and received the GNAT error
that the attribute is only for Float types (That's what the ARM says,
too).

Does anyone have an easy way to extract the integer portion of a decimal
number - short of writing a function? Seems Ada should allow this (and
other attributes) for fixed and decimal types, but it doesn't without
first converting the value to decimal.

Thanks
-- 
----------------------------------------------------------------
-                   John J. Cupak Jr, CCP                      -
- Raytheon Electronic Systems: Software Engineering Laboratory -
- tel: 508-858-1222     email (work): jcj@swl.msd.ray.com      -
- fax: 508-858-4336     email (home): jcupak@aol.com           -
----------------------------------------------------------------




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1998-01-02  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-12-30  0:00 Help: Truncating Decimal Types John J. Cupak Jr.
1997-12-30  0:00 ` Robert Dewar
1998-01-02  0:00   ` Peter Hermann
1998-01-02  0:00     ` Robert Dewar

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