Salesforce

ChkDgt (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

ChkDgt (Magic xpa 3.x)

Generates a check digit. A check digit is a digit added to a number, either at the end or the beginning, that validates the authenticity of the number. A simple algorithm is applied to the other digits of the number which yields the check digit. By running the algorithm and comparing the check digit you get from the algorithm with the check digit encoded with the number, you can verify that you have correctly read all of the digits and that they make a valid combination. Check digits are used for credit cards and identification numbers.

Syntax:

ChkDgt(string,numeric)

Parameters:

string – An alpha string representing the number for which the check digit has been calculated. The number should be converted to alpha type before this function is applied.

numeric – A numeric value representing Modulus 10 or Modulus 11, simple algorithms used to validate the number on a credit card.

The following are the numeric values:

0 – Modulus 10

1 – Modulus 11– International Standard Book Number (ISBN 10)

Returns:

A number

Examples:

ChkDgt('6789',0) returns 2

ChkDgt(x,0), where x contains the alpha string '6789', also returns 2

ChkDgt('6789',1) returns 10

Exceptions:

The EAN code method is not supported.

See also:

CRC

The Online and Rich Client Samples projects (program NM05 and RNM05)

Reference
Attachment 
Attachment