Check reverse example Converting a hexadecimal string to an integer.
? int2hex(100)
FUNCTION int2hex (num)
DECLARE INTEGER wnsprintf IN Shlwapi;
STRING @lpOut, INTEGER cchLimitIn,;
STRING pszFmt, INTEGER
LOCAL lnResult, lcResult
lcResult = SPACE(20)
lnResult = wnsprintf(@lcResult, 20, "%x", num)
RETURN Left(lcResult, lnResult)
This can also be done with:
TRANSFORM(num, "@0")
not including VFP3.