The value range of type P fields depends on their length and the number of decimal places. P fields can be 1 to 16 bytes long, with two decimal digits packed into each byte, and one decimal digit and the sign packed into the last byte. There can be up to 14 decimal places. Auxiliary fields for intermediate results are always 16 bytes long and can thus hold up to 31 decimal digits. To ensure that the decimal point is correctly calculated, you should always set the program attribute "fixed point arithmetic". Otherwise, all numbers are specified as integers and all intermediate results for the next integer are rounded. If "fixed point arithmetic" is not set, the decimal places defined for the number only appear when outputting with WRITE.
Fixed point arithmetic is decimal arithmetic and is similar to using a pocket calculator or calculating with paper and pencil.
Type P is typically used for sizes, lengths, weights and sums of money.
Add comment