LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

format into string hex

I have a question on fromat into string.  I have some problems when I use %02x to format a decimal value.  The decimal value is 9, but the hex in the string is 3039?  Why is that?  See atttached. 

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 1 of 5
(5,395 Views)
Turn off Hex display on your string.
0 Kudos
Message 2 of 5
(5,381 Views)

But I would like to keep on hex display on though.  Is there another way?

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 3 of 5
(5,379 Views)
On my phone so no code, but I typically convert the number to a byte array and use those functions.
0 Kudos
Message 4 of 5
(5,371 Views)

Formating a string to hex, shows the Hex representation of number in ASCII. The Hex value of the character '0' is 30 and '9' is 39. You can also type cast the number to a string, and concat that onto the end the reset cmd string. But it'll probably be less confusioning work with a byte array as Darin K. suggested.

0 Kudos
Message 5 of 5
(5,358 Views)