The D2X function returns a hexadecimal representation of a decimal number.
result = D2X( number [, length ] ) |
Note: there are some surprising results when the length is shorter than the minimal length required. Study the following examples.
Examples:
say D2X( 7 ) | shows: 07 |
say D2X( 129 ) | shows: 81 |
say D2X( 129, 2 ) | shows: 81 |
say D2X( 1432, 2 ) | shows: 98 SURPRISE ! |
say D2X( 1432, 4 ) | shows: 0598 |
say D2X( -127, 1 ) | shows: 1 SURPRISE ! |
say D2X( -127, 2 ) | shows: 81 |
say D2X( -1, 4 ) | shows: FFFF |