Script functions reference > Script functions in alphabetical order > M > Mod10

Mod10
Syntax
Mod10(str)
str 
Description
Performs a Pad 10-based check digit calculation with the alternating weights 2 and 1, starting at the end of the string. The digits of the values are summed. This check digit calculation method is known as Luhn's algorithm.
Returns
A string specifying a single digit number (0-9).
Example
{
    $billnr="1234567890";
$checkdigit=mod10($billnr);
$newbillnr=$billnr+$checkdigit;
}
 
Result:
$checkdigit is "3"
$newbillnr is "12345678903"
OpenText StreamServe 5.6 Updated: 2013-03-01