LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

losing digits with numeric conversion

Labview is removing trailing zero's at the left. It's working numerical.

 

But I want to do binary conversions and don't want the trailing zero's to be touched because I use it for vesion numbering.

 

How to keep them?

0 Kudos
Message 1 of 6
(2,759 Views)

Please explain your problem better, are you converting between string and datatype? Do you want to see all 0's in a indicator?

 

For the indicator you can change it's Properties to show extra zeroes, for conversion there's a bunch of ways.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 6
(2,757 Views)

Following example removes the left zero's.

0 Kudos
Message 3 of 6
(2,754 Views)

Hi JoVMo,

 

You can right click the numberic indicator and click on "Display Format..."

 

There is a tick box that says "Use minimum field width".

 

Tick that and select the number of digits you want to display.

 

There is then a drop down menu that allows you to select:

 

Pad with spaces on the left

Pad with spaces on the right

Pad with zeros on the left

 

Steve

Stephen C
Applications Engineer
0 Kudos
Message 4 of 6
(2,749 Views)

And a conversion back to string let it drop the zero's. ??

0 Kudos
Message 5 of 6
(2,747 Views)

Use the "Format Value" function with a format specifier of %08B (8 binary characters).

 

Hope this helps.

 

Steve

Stephen C
Applications Engineer
0 Kudos
Message 6 of 6
(2,742 Views)