You are here: Grammar and Syntax > Assignment Statements > Numeric Constants

Numeric Constants

You can use numeric constants anywhere in a source expression. There are two types of numeric constants: integer and decimal. Do not include commas in either type.

Integer Constants

Integer Constants contain whole numbers. Negative integer constants are preceded by a minus sign. Here is an example of a source expression which contains an integer constant:

$FinalTotal = $SubTotal + 15

In this example, the integer constant 15 is added to the value of the decimal target variable $SubTotal (which was previously calculated). The result is stored in a new decimal target variable named $FinalTotal.

Decimal Constants

Decimal Constants contain fractional numbers with a decimal point. They can contain a fractional portion, represented by the digits to the right of the decimal point. Negative decimal constants are preceded by a minus sign. Here is an example of a source expression containing decimal constants:

$My_Dec_Constant = 3.14810

$Answer = $My_Dec_Constant * 10.80

In this example, the decimal constant 3.14810 is stored in the decimal target variable $My_Dec_Constant. The value in the decimal target variable $My_Dec_Constant is then multiplied by the decimal constant 10.80. The result is stored in a new decimal target variable named $Answer.