I’m always a little worried when using a credit card at a place where there is a tip line and the server has to manually enter the total amount into the computer. It is easy for the value to be enterred incorrectly either by accident or on purpose. I’m wondering if there’s an easy checksum method I can use to catch these errors when I view the entry on my CC bill.
For example, say the food+tip is 27.53. An easy checksum is to add up the digits except for the last one (27.53 = 2 + 7 + 5 = 14) and then replace the last digit of the total with the last digit of the checksum (4 in this case). So I would change the total to be 27.54. Now when my CC statement comes I can easily validate that the amount wasn’t changed by redoing the checksum calculation and verifying the last digit matches.
However, the tough thing with this scenario is that I can’t just change the total line. I have to change the tip line so that the total comes out correct. If the original scenario is this:
Food: $22.94
Tip: $4.59 (20%)
Total: $27.53
I can’t just change the total from 27.53 to 27.54. I have to actually change the tip entry. But if I change the tip entry, the total changes and I have to come up with a new checksum digit.
One initial way I thought would work is to leave the last digit of the tip blank and fill it in after computing the checksum. For example:
Food: 32.01
Tip: 6.4_
Total: 38.4_ 3 + 8 + 4 = 15 —>> checksum = 5
So with a checksum = 5, I replace the blank with the number so it adds up to 5:
Food: 32.01
Tip: 6.44
Total: 38.45
But, this only works if the ones digit increases. If it needs to decrease, I can’t use this method.
Food: 32.07
Tip: 6.4_
Total: 38.4 (checksum is still 5)
I can’t replace the _ in the tip with a number so that the total ends up with a 5. I need to increase the tip by .08 which changes the tens digits which means I’d have a new checksum.
So, is there a simple checksum method I could use? It needs to be a simple method I can do in my head without having to correct any amounts I may have already written down.