johncassell
Well-known member
Hi There,
I need help calculating a checkdigit for a particular tank number...
A tank number is always 4 letters followed by 6 numbers and then 1 check digit. Example of tank number ABCD123456-3
Letters are given the value of A=1, B=2....Z=26
You convert ABCD123456 into all numbers (So, 1234123456)
You then multiply each one by the following values..
1 2 4 8 16 32 64 128 256 512
-----------------------------------------
Giving this list of numbers...
1 4 12 32 16 64 192 512 1280 3072
Add all resultant nos to give total = 5185
Divide total by 11 5185/11=471.3636364
Multiply whole no by 11 471 x11=5182
Subtract result from 1st total 5185-5182=3
The result is the check digit =3
Hope your still with me at this point and are able to give any pointers in how to calculate this in VB.
Thanks
John
I need help calculating a checkdigit for a particular tank number...
A tank number is always 4 letters followed by 6 numbers and then 1 check digit. Example of tank number ABCD123456-3
Letters are given the value of A=1, B=2....Z=26
You convert ABCD123456 into all numbers (So, 1234123456)
You then multiply each one by the following values..
1 2 4 8 16 32 64 128 256 512
-----------------------------------------
Giving this list of numbers...
1 4 12 32 16 64 192 512 1280 3072
Add all resultant nos to give total = 5185
Divide total by 11 5185/11=471.3636364
Multiply whole no by 11 471 x11=5182
Subtract result from 1st total 5185-5182=3
The result is the check digit =3
Hope your still with me at this point and are able to give any pointers in how to calculate this in VB.
Thanks
John