Show only remainder

bill crumpton

Registered User.
Local time
Today, 10:07
Joined
Apr 20, 2000
Messages
105
I am doing a long division in an unbound field and would like a certain unbound field to show only the remainder of the division not the whole number. For example, if unbound field [Text 2] is dividing 327 by 11 I want unbound field [Text 4] to show only the .8 remainder of that division problem. Any help is greatly appreciated.

BAC
 
Alan,
Thanks for response and this does capture the remainder, however it is rounding up. Any way to get just the first number after the decimal point without rounding up? Thanks.\\BAC
 
Do you want the remainder, or the fractional part of the quotient (not the same thing)? There is no "rounding up" going on - the Mod operator gives you the remainder of an integer division, which is itself always an integer. If you want the fractional part of the quotient (0.727272... in your example), use this:

[Text 4] = (327 / 11) - (327 \ 11)

Note that the forward slash performs regular division and the backslash performs integer division (discarding the remainder), and the difference between them is the fractional part you want. To get only the first digit without rounding, use:

[Text 4] = Int((327 / 11) - (327 \ 11) * 10)

You can find other ways of performing this kind of manipulation by reviewing the help topics on the CInt, CLng, Fix, Int, Mod and Format functions.

[This message has been edited by AlanS (edited 04-23-2001).]
 
Sorry Alan, the first response was correct. Thanks for your help.

BAC
 

Users who are viewing this thread

Back
Top Bottom