LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Format strings, need leading zeros

Use a format string of %x for the Scan From String and a format string of %04x for the Format Into String.
0 Kudos
Message 11 of 14
(3,514 Views)
Almost, I had tried that, but my Input String contains hexidecimal characters, and changing the Format Specifier to x actually converts the DBL value to hexidecimal for the resulting Output String.  It will not handle the ABCDEF characters in the Input String.  Looks like I will need to do some converting of the Input Sting.  Thanks DK.
0 Kudos
Message 12 of 14
(3,511 Views)
I'm not sure I understand the problem. I made the changes and entered a string of 'ef'. What I got out was '00EF'.
Message 13 of 14
(3,497 Views)
Got it, I had only changed the Format Specifier on the format into String vi.  The Format Specifier must be changed on the scan from string as well. 
 
Another solution is to convert the Input String to a number with a Hexidecimal String to Number vi, and then format the resulting Numeric display as Hexidecimal, Pad with zeros on left.
 
Thanks
0 Kudos
Message 14 of 14
(3,490 Views)