Skip to Content
avatar image
Former Member

what is the default size of a packed field?

hi

what is the default size of a packed field?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 09, 2007 at 06:14 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 09, 2007 at 06:12 AM

    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
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 09, 2007 at 06:14 AM

    hI,

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

    Thanks.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 09, 2007 at 06:17 AM

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

    Add comment
    10|10000 characters needed characters exceeded