On Tuesday, October 20, 2020 at 2:37:05 PM UTC+1,
[email protected] wrote:
Hi,
Anyone has code to create the last digit from an ean13 barcode.
And also the code to convert the barcode to be able to print it with a windows ean-13 font?
Greetings,
Jos Dequeker
A Barcode is just a number and the last digit oof an EAN 13 code is a check digit. It sould be easy to retrieve the last (rightmost) digit from this number.
Try something like this.
xcode = int(barcode /10) !to strip out the last digit
ycode = barcode % (xcode*10) !the modulus operator should return the last digit of the barcode
There might be other (simpler, or even correct) solutions but I haven't had my coffee yet!
Printing should not be an issue. I guess that there must be a few barcode printing templates out there.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)