Remove Unwanted Decimal Places from Printing Fields

Removing unwanted or decimal places from a printing field on a label

Circumstances may cause a field on a label to print with too many decimal places. For example, 12.340000 may print instead of the desired value of 12.34. This behavior will sometimes occur when numeric data is being retrieved by a label with ODBC (Microsoft's Open Database Connectivity) connections to a database. There may also be cases where you prefer either fewer decimal places or all the decimal places to be removed from the desired field on the printed label.
This issue can be solved easily using the following steps:

  1. Open the affected label using Loftware's label design program, Design 32.
  2. Change the field with too many decimal places to a non-printing field. This can be done by either placing the field directly on the On Demand Print Form or by changing the "Printing Field" property for the label from "Yes" to "No."
  3. Place a new field on the LabelClosed A label is a design area on the computer screen where a label format is created or edited. Design view and set the "Data SourceClosed Where data is extracted to produce labels. Loftware Label Manager provides a variety of data sources, including the keyboard, a database, serial number, a formula, via the UCC or UPN Wizard. For RFID labels and tags, data can come from the Keyboard data source or by configuring data blocks using the Block Configuration data source." property for this new field to Formula.
  4. In the formula for the new field, simply reference the other field, multiply that field by 1,  and set the desired number of "Decimal digits".
  5. Save the modified label.


In the screen shot below, the original field is named "Weight" and the new field is named "New_Weight". Let's assume the value returned to the field named Weight is 12.340000.

  • New_Weight will have a value of 12.34 because the "Decimal digits" specified for the calculated result is 2 places.
  • If "Decimal digits" is changed to 1, the value of New_Weight would be 12.3.
  • If "Decimal digits" is changed to 0, the value for New_Weight would be 12 without any decimal point.

     

By using the method shown above, the label designer can ensure only the desired number of decimal places print on the label.