Question
Ruiyan Yu · May 2

$System.Util.DecimalToHex

Hi,

Doc: classMethode DecimalToHex(decimal As %String) as %String
Converts a decimal string to a hexadecimal string.

w !,$System.Util.DecimalToHex(42) > 2A

w !,$zhex(42) > 2A

 

w !,$System.Util.DecimalToHex(0) is empty

w !,$System.Util.DecimalToHex("0") is empty

w !,$System.Util.DecimalToHex("00") is empty

w !,$zhex(0) > 0

Is the empty string really the intended output?

Best regards

RY

$ZV: Cache for Windows (x86-64) 2018.1.5 (Build 659) Mon Mar 22 2021 07:15:21 EDT
1
0 84
Discussion (1)1
Log in or sign up to continue

Both still return 1 character for numbers up to 16 

II would recommend this way, instead

$Translate($Justify($Zhex(dec),2)," ", 0)