# Text input formula calculation 追蹤 Shonn Mereness

Need a vb script to take text input(4 digit numeric value) and calculate the one digit price check digit based on the below calculation:

The Price Check Digit is used only for random weight or variable measure products sold at the retail POS (see Section 3.1 of the Guidelines for Supply Chain Identification). These products are identified with VMN-12 where the U.P.C. Prefix is 2 (Position One is Number 2). Here is how to calculate the Price Check Digit:

Step One:

Convert the four digits (numbers) in the four-digit price to new numbers by finding their new value in the tables below: (NOTE: These "new numbers" never appear in the bar code or human readable text. They are only used for Price Check Digit calculation.)

For the first two digits:

 If the digit is: 0 1 2 3 4 5 6 7 8 9 The new digit will be: 0 2 4 6 8 9 1 3 5 7

For the third digit:

 If the digit is: 0 1 2 3 4 5 6 7 8 9 The new digit will be: 0 3 6 9 2 5 8 1 4 7

For the fourth digit:

 If the digit is: 0 1 2 3 4 5 6 7 8 9 The new digit will be: 0 5 9 4 8 3 7 2 6 1

Say, for example, the four digits in the price are 0512. By using the tables above, new values would be assigned to each of the four numbers before using them in Step Two. For example the value of 0 (first digit) would remain 0, the value of 5 (second digit) would change to 9, the value of 1 (third digit) would change to 3, and the value of 2 (fourth digit) would change to 9. This means the new values would be represented as 0939.

Step Two:

Add the four new digit values:

(0 + 9 + 3 + 9 = 21).

Step Three:

Multiply the result of Step Two by 3:

(21 x 3 = 63).

Step Four:

The Price Check Digit is always the number in the units position (right-most digit) of the result of Step Three. For example, because the result in Step Three is 63, the Price Check Digit in our example is 3, because 3 is the right-most digit.

Additional Information: For further details on this subject, see Guideline 11 (Random Weight) in the GTIN-12 (U.P.C.) Guidelines.