Serial NO. : I005010-EN
Date of Editing : 2012-09-12
Questions : The conversion of WG format and ABA10 digit format?
Problem Solving :
SOYAL EM card (EM4001) is printed with two format card number on the front cover as below
One format is WG and another format is ABA10
WG format: it is composed with two set of 5-digital, the left 5 digital is Site code, the right digital is Card code
ABA10 format: it is composed with one set of 10-digital
The two format can be convert each other via the formula.
1. WG convert into ABA10
SitecodeX65536+Cardcode=ABA format
For instance : (12 * 65536) + 62363= 848795
Because ABA10 is 10 digital, so the shortage digit need to be full with 4 digital “0”, the result of ABA10 is 0000848795
2. ABA10 convert into WG
Step1 Sitecode =(ABA10 value) ÷65536 =XXXXX.XXXX ( Quotient. Remainder) , take Quotient as Sitecode
For instance: 848795÷65536=12.9515, Quotient 12 as Sitecode 00012
Step2 Cardcode=(ABA10 value) -(quotient)*65536
For instance: 848795-12*65536=62363
So the result as WG format is 00012:62363