Variables and Calculations

Overview

The VAR1 and VAR2 ticket keywords are used to store numeric values for simple calculations. The calculated result can be printed on tickets. 

This is only a ticketing feature. Calculations are only printed on the ticket, they cannot be stored in the database. Only two variables can be defined.

Setting Var1 and Var2 values

To set variable 1 or 2 to a database value, place the database field within square brackets. For example:

  • VAR1 [Net Weight] will set the variable 1 value to the Net Weight value stored in the database.

To set variable 1 or 2 to a constant value, place the constant within double quotes. For example:

  • VAR2 “2000” will set the variable 2 value to a constant value of 2000.

Calculations

Once values have been assigned to VAR1 and VAR2 the following operations can be used for simple calculations.

  • [VAR ADD]
    • Adds VAR1 + VAR2
  • [VAR SUB]
    • Subtracts VAR1 – VAR2
  • [VAR MULT]
    • Multiplies VAR1 * VAR2
  • [VAR DIV]
    • Divides VAR1 / VAR2

All calculations will be rounded to the nearest whole number unless the operation is followed by one of the following characters 0, 2, 4, or 6. The number represents the number of places after the decimal point to be printed; for example [VAR DIV2] will print two decimal places. The value is rounded up or down based on the number in the next position. 

Examples

VAR1 [Net Weight] VAR2 [Weight In] [VAR DIV] This will print the result when the Net Weight is divided by the Weight In. The result will be rounded to the nearest whole number.

VAR1 [Net Weight] VAR2 “2000” [VAR DIV4] This will print the result when the Net Weight is divided by 2000. The result will not print beyond 4 decimal places; i.e. 5.1234.

VAR1 [Adj Weight] VAR2 [Notes 21] [VAR ADD] This will print the result when the Adjusted Net Weight and a value stored in Note 21 are added together. Note 21 must contain a number. The result will be rounded to the nearest whole number.

The numbers calculated may be floating point numbers (9.xxxE02) format if they extend below the decimal point.