× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Other results:

Divide by 100.0 yields a result with one decimal position
Divide by 100.00 yields a result with tw0 decimal positions

These variations are interesting only, I think, in that they reveal something more about how RPG handles complex numeric expressions. Martin, yours seem to be the best solutions suggested so far.

Brian Johnson


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Hillier, Martin
Sent: Wednesday, January 20, 2010 9:38 AM
To: RPG programming on the IBM i / System i
Subject: RE: Decimals in division

Hi

Have a look at the expression options on the Control spec, or try changing the calc spec to add the op code extender 'Result decimal positions':
EVAL(r) neto$ = imp$ / ( 1 + porciva /100);

Cheers,
Martin


_______________


Confidentiality Notice: This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately.

________________

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.