十六进制数如何格式化
我想要得到一个四位的十六进制数,如不足四位的用0补足,如32得到 0032,acb得到0acb有什么好办法吗? :
dim Buff as string
buff=" " '几位就几个空格
rset buff="acb"
buff=replace(buff," ","0")
msgbox buff
Dim strHex As String
strHex = "123"
msgbox Right("0000" & strHex,4)
Dim strP as String
Dim strHex as String
strP="32"
strHex=Right("0000" & strP,4)
Debug.print strHex