Thanks, I'll have a look at that.
No, I would like to give simplified fractions.
Best regards,
Mark
-----Original Message-----
From: cobol400-l-bounces@xxxxxxxxxxxx [mailto:cobol400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Lindstrom
Sent: 01 December 2009 15:48
To: COBOL Programming on the iSeries/AS400
Subject: Re: [COBOL400-L] Fractions ... help!
This looks like an answer in visual basic; maybe that will help.
http://mathforum.org/library/drmath/view/51910.html
I assume you do not want output like '90/100' and '45/100'; you want them
simplified.
Scott Lindstrom
"Austin, Mark"
<Mark.Austin@umus
ic.com> To
Sent by: "cobol400-l@xxxxxxxxxxxx"
cobol400-l-bounce <cobol400-l@xxxxxxxxxxxx>
s@xxxxxxxxxxxx cc
Subject
12/01/2009 09:29 [COBOL400-L] Fractions ... help!
AM
Please respond to
COBOL Programming
on the
iSeries/AS400
<cobol400-l@midra
nge.com>
Hi all,
I have an interesting problem to solve and not being a mathematician I'm
looking for some help.
I have got a number of records on a file which each have a percentage. I
need to read these records and output the percentage, as a fraction, in two
fields (a numerator and a denominator). The denominator needs to be the
same for each record but cannot be greater than 999 (as the denominator
field length is 3).
Has anyone else had to do anything like this? Any pointers would be
appreciated.
This is going to be written in ILE COBOL.
For example,
9.95%
2.19%
2.18%
0.21%
0.90%
0.45%
0.19%
0.18%
17.50%
50.00%
4.38%
4.37%
7.50%
Best regards,
Mark
________________________________
"**Confidentiality**
The information contained in this e-mail is confidential, may be privileged
and is intended solely for the use of the named addressee. Access to this
e-mail by any other person is not authorised. If you are not the intended
recipient, you should not disclose, copy, distribute, take any action or
rely on it and you should please notify the sender by reply. Any opinions
expressed are not necessarily those of the company.
We may monitor all incoming and outgoing emails in line with current
legislation. We have taken steps to ensure that this email and attachments
are free from any virus, but it remains your responsibility to ensure that
viruses do not adversely affect you.
--
This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) mailing
list
To post a message email: COBOL400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
http://archive.midrange.com/cobol400-l.
--
This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) mailing list
To post a message email: COBOL400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
http://archive.midrange.com/cobol400-l.
"**Confidentiality**
The information contained in this e-mail is confidential, may be privileged and is intended solely for the use of the named addressee. Access to this e-mail by any other person is not authorised. If you are not the intended recipient, you should not disclose, copy, distribute, take any action or rely on it and you should please notify the sender by reply. Any opinions expressed are not necessarily those of the company.
We may monitor all incoming and outgoing emails in line with current legislation. We have taken steps to ensure that this email and attachments are free from any virus, but it remains your responsibility to ensure that viruses do not adversely affect you.
As an Amazon Associate we earn from qualifying purchases.