ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Declare a decimal number

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Declare a decimal number

    To declare an integer number, I know two ways:

    Code:
    dcl-s numberInteger packed(5:0);
    dcl-s numberInt int(5);
    Now, to declare a decimal number, I know only a statement

    Code:
    dcl-s numberDecimal  packed(5:2);
    Do know you an other way, please?

  • #2
    Hi Juliette,

    here's the Bible of any RPG programmers:

    Numeric Data Type, data type, numeric, numeric data type, allowed formats


    If you need an integer number I suggest type INT (integer) or UNS (Unsigned Integer).

    For decimal number you can use Packed or Zoned.

    Bye

    Comment


    • #3
      Hello Paolinosal,

      Thank you very much for your reply.

      Comment

      Working...
      X