Serials: Difference between revisions

m adding Algorithm as a single formula to summerise the paragraph.
 
Line 8: Line 8:


After separating the digits, add the digits in each group together.  Multiply the sum of the even digits by 3, then add the sum of the odd digits. To calculate the check digit, take this value modulo 10, and if not 0, subtract from 10.
After separating the digits, add the digits in each group together.  Multiply the sum of the even digits by 3, then add the sum of the odd digits. To calculate the check digit, take this value modulo 10, and if not 0, subtract from 10.
Algorithm: check digit = (10 - (((3 * evenSum) + oddSum) % 10)) % 10


Example: CW404567772
Example: CW404567772