"Mark" <mmorrow@earthl ink.net> wrote in message
news:7QBRc.1730 4$Jp6.16451@new sread3.news.atl .earthlink.net. ..[color=blue]
> Why does MsgBox 4.25 MOD 1 display 0? I was hoping to get .25.
>
> Thanks!
>
> Mark
>
>[/color]
"Mark" wrote
[color=blue]
> Why does MsgBox 4.25 MOD 1
> display 0? I was hoping to get .25.[/color]
When you round 4.25 to an integer, you get 4. When you divide 4 by 1 you get
a result of 4 and a remainder of 0. That's why you get 0.
From Access 2003 (Visual Basic 6.3) Help (and the definition of Mod hasn't
changed since Access 1.0, AFAIK):
"Remarks
The modulus, or remainder, operator divides number1 by number2 (rounding
floating-point numbers to integers) and returns only the remainder as
result. For example, in the following expression, A (result) equals 5.
A = 19 Mod 6.7"
If you want to show the "fractional part", you could try
4.25 - Int(4.25)
Larry Linson
Microsoft Access MVP
"Mark" <mmorrow@earthl ink.net> wrote in message
news:7QBRc.1730 4$Jp6.16451@new sread3.news.atl .earthlink.net. ..[color=blue]
> Why does MsgBox 4.25 MOD 1 display 0? I was hoping to get .25.
>
> Thanks!
>
> Mark
>
>[/color]
Don't get mad --- get even! :-)
=============== =============== =============== =============== =============== =
====
"Mark" <mmorrow@earthl ink.net> wrote in message
news:7QBRc.1730 4$Jp6.16451@new sread3.news.atl .earthlink.net. ..[color=blue]
> Why does MsgBox 4.25 MOD 1 display 0? I was hoping to get .25.
>
> Thanks!
>
> Mark
>
>[/color]
Comment