Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

what is the default size of a packed field?

Former Member
0 Kudos

hi

what is the default size of a packed field?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

max length is 16 and max number of decimals is 14.

data:pac(16) type p decimals 14 value '1234'.

write:/ pac.

reward if helpful

4 REPLIES 4

Former Member
0 Kudos

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.

Former Member
0 Kudos

hI,

max length is 16 and max number of decimals is 14.

Thanks.

Former Member
0 Kudos

Hi,

max length is 16 and max number of decimals is 14.

data:pac(16) type p decimals 14 value '1234'.

write:/ pac.

reward if helpful

Former Member
0 Kudos

max length is 16 and max number of decimals is 14.