LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

truncate data

Hi All,
 
I want to truncate data (for instance 12.x where x is any decimal from 0 to 9 to be shown as 12 only), Is there any direct function available to do this instead of do some round about work, the way I tried is shown in below attached png.
 
 
Thanks
 
Kousy
 
0 Kudos
Message 1 of 5
(3,271 Views)
Hi Kousy
 
Just open the properties of the control and select the "Format and Precision" tab. There you can set how the value should be displayed.
 
Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 5
(3,270 Views)

Hi becktho,

I dont want my data to get rounded off, by setting digits of precision to 0 but i want just to truncate the decimal part, functionality similar to the one available in c, vb etc.

I want to display 12.2 or even 12.8 to be displayed as "12" only not to 12 or 13 respectively.

 

Kousy

0 Kudos
Message 3 of 5
(3,264 Views)

Sorry I missed that.

I don't know of a specific method to do what you want, but you could simply use a round function. To still have the original data available, just round the data and wire it to a separate indicator.

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 4 of 5
(3,260 Views)

Thanks becktho.

This is what I searched all over functions palettes. I am aware of round to nearest function. Even then I missed this functionality somehow. Anyway  thanks once again.

 

Kousy

0 Kudos
Message 5 of 5
(3,253 Views)