Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Modulo Function that allow decimal

Posted on 2001-06-11
4
Medium Priority
?
1,820 Views
Last Modified: 2008-03-06
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.
0
Comment
Question by:Pomme
4 Comments
 
LVL 7

Expert Comment

by:lmerrell
ID: 6178006
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
 

Author Comment

by:Pomme
ID: 6178468
MODULO or MOD is a build in access function you can find it in the help...under MOD
0
 
LVL 8

Expert Comment

by:DennisBorg
ID: 6178529
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
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 200 total points
ID: 6178740
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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question