Bank_US::calcRoutingNumberCheckDigit Method [AX 2012]
Calculates the check digit value, given an eight digit bank account routing number.
Syntax
client server public static int calcRoutingNumberCheckDigit(str _routingNumber)
Run On
Called
Parameters
- _routingNumber
Type: str
A routing number.
Return Value
Type: int
The check digit value.
Remarks
The check digit is calculated as follows:
1) Multiply each digit in the routing number by a weighting factor.
The weighting factors for each digit are as follows:
Positions: 1 2 3 4 5 6 7 8
Weights: 3 7 1 3 7 1 3 7
2) Add the results of the eight multiplications.
3) Subtract the sum from the next highest multiple of 10. The result is the check digit.
Examples
// Routing Number of 07640125 yields a Check Sum = 109
// (0 + 49 + 6 + 12 + 0 + 1 + 6 + 35)
// Check Digit = 1 (110 - 109)