Contents | Index | < Browse | Browse >
usage: D2X(number,[digits])

-converts a decimal number to hexadecimal.
-digits argument sets the number of rightmost hex digits returned of the result.
-digits argument cannot be greater than 8.
-the result is padded with zeros on the left according to the digits argument.
-see also numeric digits and x2d() .

The ARexx reference manual does not explain the digits argument. Comments welcome [see About ].

The following example executed from the DOS shell illustrates the action that takes place with/without the digits argument ( "--->" denotes the result):

say d2x(672850) ----> A4452
say d2x(672850,0) -->
say d2x(672850,1) --> 2
say d2x(672850,2) --> 52
say d2x(672850,3) --> 452
say d2x(672850,4) --> 4452
say d2x(672850,5) --> A4452
say d2x(672850,6) --> 0A4452
say d2x(672850,7) --> 00A4452
say d2x(672850,8) --> 000A4452
say d2x(672850,9) --> Invalid argument to function