Computer Learning Zone CLZ Access Excel Word Windows

You can not become a scientist if you require that every question has an answer because its the very questions that have no answer that attract you to a laboratory every single day.

-Neil deGrasse Tyson
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Check Register Seminar Notes    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Rounding Error Discovered
Richard Rost 
          
6 years ago
One of our Lt. Commanders, John Davy, brought to my attention a rounding error in the CurrencyToEnglish function. If you enter a check for $4,999,999.99 then it prints on the check as "Five Million Dollars." Turns out that there's a problem using integer division. If you type in:

X = 4999.99 \ 4000

You would expect to get 4. Nope. You get a 5. I forgot to take into account that integer division uses the rules that the Round function uses for Banker's Rounding. See that link for complete reasons why.

Fortunately, it's an easy fix. Instead of using integer division we'll just divide and use the INT function to chop off the decimal place. So you only have to change three lines of code:

' Billions
    B = Int(C / 1000000000)

' Millions
    M = Int(C / 1000000)

' Thousands
    T = Int(C / 1000)


That's it. I've already updated the Code Vault and replaced the code in the database in the course ZIP file. So if you're using that, I strongly recommend you update it. It will only happen rarely, but like John said, "a penny isn't much, but the accountant wouldn't like it."
Richard Rost OP  @Reply  
          
6 years ago
The videos really aren't affected because I don't explain HOW the code was written in class. I just give a basic overview of how to use it. But this is why you should always check the notes and addendums. :)
Richard Rost OP  @Reply  
          
6 years ago
Fixed another problem today. CInt changed to Int. CodeVault and DB have been updated.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Check Register Seminar Notes.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/6/2026 10:16:19 AM. PLT: 1s