comp.lang.ada
 help / color / mirror / Atom feed
From: "John J. Cupak Jr." <jcj@swl.msd.ray.com>
Subject: Help: Truncating Decimal Types
Date: 1997/12/30
Date: 1997-12-30T00:00:00+00:00	[thread overview]
Message-ID: <34A9138E.41C67EA6@swl.msd.ray.com> (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           -
----------------------------------------------------------------




             reply	other threads:[~1997-12-30  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-12-30  0:00 John J. Cupak Jr. [this message]
1997-12-30  0:00 ` Help: Truncating Decimal Types Robert Dewar
1998-01-02  0:00   ` Peter Hermann
1998-01-02  0:00     ` Robert Dewar
replies disabled

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