Modulo Function that allow decimal

In VBA the function modulo round decimals before carrying out calculation. I seek a function which won't round the decimal before carrying out the modulo.
PommeAsked:
Who is Participating?
 
Jim Dettman (Microsoft MVP/ EE MVE)Connect With a Mentor PresidentCommented:
Multiply the numbers by 10 rasied to the x power where x represents the number of decimals that you might have.  Then perform the mod.

Jim.
0
 
lmerrellCommented:
Pomme,


I'm guessing you need to declare your arguments and/or any variables used in the function as Double instead of Integer.  I could tell you for sure if you post the Function here.


lmerrell
0
 
PommeAuthor Commented:
MODULO or MOD is a build in access function you can find it in the help...under MOD
0
 
DennisBorgCommented:
Pomme:

MOD is an operator which works only with Integer numeric types; which is why it will round any Real numbers before performing the MODULO operation.

I am not certain exactly what you are seeking. Are you wanting to *truncate* the fractional part of the numbers and then perform the MODULO operation?

At any rate, you will need to write your own custom function to accomplish what you desire.

-Dennis Borg
0
All Courses

From novice to tech pro — start learning today.