Convert a number to hexadecimalTag(s): Powerscript
About cookies on this site
We use cookies to collect and analyze information on site performance and usage,
to provide social media features and to enhance and customize content and advertisements.
[of_long2hex(long alnumber, integer ai_digit) returns a string]
long ll_temp0, ll_temp1
char lc_ret
IF ai_digit > 0 THEN
ll_temp0 = abs(al_number / (16 ^ (ai_digit - 1)))
ll_temp1 = ll_temp0 * (16 ^ (ai_digit - 1))
IF ll_temp0 > 9 THEN
lc_ret = char(ll_temp0 + 55)
ELSE
lc_ret = char(ll_temp0 + 48)
END IF
RETURN lc_ret + &
of_long2hex(al_number - ll_temp1 , ai_digit - 1)
END IF
RETURN ""
// of_longhex(256, 4) returns "0100"
// of_longhex(256, 3) returns "100"