× 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.



Hi Booth,

%int is probably what you're looking for, although I'm not sure if your
formula would work in all situations.  If the amount is $500.00, your
formula would also be $8.00.  How about

fee = 4.00 * %inth(0.4999999 + ($650 / $500));

Then for $500 you'd get $4, and for $500.01 you'd get $8.

hth,
Peter Dow
Dow Software Services, Inc.
www.dowsoftware.com
909 793-9050 voice
909 793-4480 fax

> -----Original Message-----
> From: rpg400-l-bounces@xxxxxxxxxxxx
> [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Booth Martin
> Sent: Friday, January 27, 2006 2:27 PM
> To: RPG programming on the AS400 / iSeries
> Subject: eval divide and drop decimals.
>
>
> I need to charge a fee of $4.00 per $500, or fraction thereof.
>
> So, if the Amount is $650.22 then the fee will be $8.00.  All these
> fields are currency, so they are 2 decimals.
>
> C  eval   fee = $4.00 * ( 1 + ($650 / $500))
> gives the result I want, excepting that $650/$500 is not 1.00
>
> I want to drop the decimals but don't know how to do it without an
> intermediate work field.
>
> Any ideas?  (Half adjust won't do it either for a couple of reasons.)
>
>
>
> --
> -----------------------------------
> Booth Martin
> http://martinvt.com
> -----------------------------------
> --
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.375 / Virus Database: 267.14.22/239 - Release Date: 1/24/2006
>
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.22/239 - Release Date: 1/24/2006



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.