Postby mjagers » Thu Aug 18, 2016 9:43 am
As its a local variable the decimal needs to define the precision and, optionally, number of decimals.
Try specifying
salary : Decimal [23,2];
Documentation is:
Decimal Type
Use the Decimal primitive type to define a variable with a fixed-precision and decimal point; for example, a monetary value such as a bank balance.
You must specify a decimal descriptor for the integer length of the decimal variable; for example, code d : Decimal [4]; to specify a length of 4. You can optionally specify the number of decimal places for the decimal variable; for example, code d : Decimal [4,3]; to specify that the variable is to be to three decimal places. (If the number of decimal places is not specified, it is assumed to be zero.)
The value of the integer length must be in the range 1 through 23. The number of decimal places must be equal to or less than the length value of the decimal descriptor.
As the decimal value for zero (0) has no fixed precision or scale factor, you can assign this value to any Decimal value. When this value is output (for example, by a write instruction), the scale factor of the property or variable defines the number of decimal places that are displayed. Null decimal values are initialized with a value of zero (0).
When performing decimal arithmetic, only the final assignment result is rounded. For example:
vars
a : Decimal[12,4];
b, tot : Decimal[12,2];