|
Lance Gillespie wrote:
I thought: target = %dech(source * 1.01) : 7 : 0)
would do it, but no joy.
half adjusting (whether you use %dech or one of the myriad other ways to half-adjust in RPG) only rounds up when the number hits the halfway point to the next higher number. Thus 1.5 would round up to 2, but 1.49 would round down to 1. That's why it's called "half adjust".
You could, of course do this:
target = %dech((source*1.01) + 0.5: 7: 0);
Seems to me that would do what you want... if not, you can always do something like this:
if %int(target) <> target;
target = %int(target) + 1;
endif;
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.