LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

trailing zeros programatically

Solved!
Go to solution

Is it possible to change the "Hide Trailing Zeros" property programmatically.

I realize that it can be easily changed statically in the development environment, but I would like to change them programatically based on a user selection.

 

Thanks

0 Kudos
Message 1 of 3
(2,772 Views)
Solution
Accepted by topic author jspaarg

Found it!

 

It's the Format String property

 

%.3f for 3 digits of precision and %.0f for no decimal places.

 

0 Kudos
Message 2 of 3
(2,767 Views)

Hi,

 

You can use this code to hide the trailing zeros:

 

%#.3f

 

This code will convert your number with 3 decimals but zeros will be truncated.

1.2345 will be converted to 1.234 and 1.2300 will be converted to 1.23

 

Best Regards

Svendsen

Message 3 of 3
(2,739 Views)