|
Ah ha! Looks promising...
Thanks.
On 7/10/2013 9:00 PM, Roger Harman wrote:
WholeNum = %int(OriginalNum);rpg400-l-bounces@xxxxxxxxxxxx <javascript:;>]
Fraction = OriginalNum - WholeNum;
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx <javascript:;> [mailto:
On Behalf Of Sam_Land
Sent: Wednesday, July 10, 2013 5:50 PM
To: rpg400-l@xxxxxxxxxxxx <javascript:;>
Subject: Split Number into whole and fractional parts
I have an 12,5 decimal field. I need to split it into the whole number
the fractional part, two fields, one 7,0 and the other 5,5.put
Put another way, if the original field is 1234567.98765 I want to end up
with two field, one 1234567 and the other 0.98765.
Is there an elegant way to do this in RGP /free at V7R1?
The original RPG IV fixed format code did it with two Z-ADDs. (Without
comments and meaningful field names, so very hard to understand.)
Thanks,
Sam
I could create a procedure, probably using multiplication and %REM.
I have an aversion to data structures for things like this, though if I
it in a procedure it would be fairly clear.--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx <javascript:;>
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx <javascript:;>
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.