LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how not to omit leading binary zeros with format into string

Solved!
Go to solution

I'm using format into string to format serial data .  The problem I'm having is that Format into String with "%b" format identifier omits leading zeros

in the string..   ie...  "3" becomes "11" when I need it as "0011"

 

 

0 Kudos
Message 1 of 4
(3,461 Views)

Add a zero to your format string. In other words, %04b tells it to pad with zeros up to 4 places. This is documented in the LabVIEW Help.

0 Kudos
Message 2 of 4
(3,457 Views)

Just tried that... it didn't work.

 

 

0 Kudos
Message 3 of 4
(3,453 Views)
Solution
Accepted by lastcall18

see figure:

 

Message 4 of 4
(3,443 Views)