×
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.
On Wed, Feb 12, 2020 at 3:30 PM Booth Martin <booth@xxxxxxxxxxxx> wrote:
I missed the "always round up" part.
That's because it wasn't there. OP probably just wanted the standard
half-adjust, which is handled with the (h) extender, per your original
suggestion.
What they did say was that what they had been doing so far "wasn't
rounding up". It was just a description of the observed behavior,
which is different than saying that they want the opposite. In other
words, the (r) extender was not doing any rounding up at all, even
though they wanted *some* numbers to round up.
Justin took it and ran with it, and it's a nice mental exercise to see
how you *would* always round up (not just at half and above). So, for
the rest of this e-mail, let's assume we want to always round up to
the nearest whole penny. One "micro-cent" should round up to one cent.
try this:
eval(h) result = (qty * price) + .005;
That should also to the trick.
Not quite. If (qty * price) happens to come out to an exact number of
cents, like 0.70, then after rounding, the result should still be
0.70. But doing it as you've shown gives us 0.71 instead.
John Y.
As an Amazon Associate we earn from qualifying purchases.