Format weight from scale for GS1-128

Issues related to label design (working with databases, data processing, RFID encoding etc.) and printing (from NiceLabel Express, NiceLabel Pro, NiceForm and NicePrint)

Moderators: Georges, milos, NiceLabel Support Team

Post Reply
bullviech
Newcomer
Posts: 1
Joined: Fri Apr 24, 2020 5:38 pm

Format weight from scale for GS1-128

Post by bullviech » Fri Apr 24, 2020 5:41 pm

Hi guys!

I'm trying to format the weight i get from my scale correctly for GS1-128. I made it already that the result is a weight like "1,234". But GS1-128 requires 6 digit weight without comma or point. So in this case it should be: 001234.

I managed output of the variable if the weight has 3 digits. but if i set the weight manually to 1 it does not work because it does not add ,000.

i used this script:

Code: Select all

var1=[Gewicht für EAN]

var1=Replace(var1,".","")
var1=Replace(var1,",","")

Do While (Len(var1) < 6)
var1 = "0" + var1
Loop

Result = var1
How can i format the value correctly?

Thank you!
Best regards

Bull

Post Reply