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



Ala, Michael A wrote:
Question about MVR operation how should the Div Result be Defined with
or without decimals

Same for Remainder Field

I have come up with various results with different formatting and want
to know best/Common practices

Example 60/84 = .714 on a calculator but one of programmers was not
getting this result with the move remainder when Both Fields were
defined with 3 decimal Places

MVR doesn't give you the decimal part of a non-integer quotient, it gives the remainder. Integer division is defined by the formula:
a = qb + r where 0 <= r < b
In your case, a = 60, b=84, so q must be 0 and r must be 64.

Also, you should consider using the %div() and %rem() built-in functions instead of DIV and MVR.

Perhaps you really want to
EVAL ratio = field1 / field2?
EVAL decimalPart = ratio - %div(field1:field2)

or, you could use DIV twice, once with a result field that has decimals (a) and one that doesn't (b). Then, a - b should give you the decimal part of the result.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.