B2X


B2X(binary_string)

Where

binary_string is a string expression containing only '0's or '1's.

Results

String

Function

The B2X function returns a string in character format, that represents binary_string converted to hexadecimal. It can be any length. You can optionally include blanks in binary_string (at four-digit boundaries only, not leading or trailing) to aid readability; they are ignored. The returned string uses uppercase alphabetics for the values A-F, and does not include blanks.

If binary_string is the null string or a string formatted other than as described above, B2X returns a null string. If the number of binary digits in binary_string is not a multiple of four, then up to three 0 digits are added on the left before the conversion to make a total that is a multiple of four.

Examples

a = B2X('10101010')                      /* Assigns 'AA' to "a"      */
b = B2X('1   0011     1100')             /* Assigns '13C' to "b"     */
c = B2X('10001110    0111')              /* Assigns '8E7' to "c"     */ 
Note: The B2X function cannot be used in asynchronous conditions.