LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NaN

How can I limit the number of precision of some value?
for exemple: I need to do a square root of the following expression:
134.456165-134.456438

In this situation I will have a negative value to do a square root and then LabVIEW will show me NaN.
I would like that LabVIEW uses just 3 numbers after the point. I don´t need more than that.
How can I do it?

Thank you

0 Kudos
Message 1 of 5
(2,862 Views)

One option would be to multiply your numbers with 1000, round to nearest integer (or towards -Inf, if you prefer), then divide by 1000.

 

Message 2 of 5
(2,851 Views)

What about the fixed point representation of a number?

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 3 of 5
(2,835 Views)

Here is a FP Compare.vi that allows the precision ( number of digits) for comparison.

 

FP Compare.JPG

Visualize the Solution

CLA

LabVIEW, LabVIEW FPGA
0 Kudos
Message 4 of 5
(2,827 Views)

Hi victormalvezzi!      

What is the source of the data?      
If the data are from a control for example, you can set the number of digits precision at the properties tab: Right click on this control -> properties. (See the details at the attached pic)      


If you don't get what you want let us know, then we can help you!

Best Regards!

 

Barbara Pracek
Engenharia de Aplicações
National Instruments Brasil

0 Kudos
Message 5 of 5
(2,786 Views)