11-18-2011 12:36 PM - edited 11-18-2011 12:41 PM
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
11-18-2011 01:22 PM
One option would be to multiply your numbers with 1000, round to nearest integer (or towards -Inf, if you prefer), then divide by 1000.
11-18-2011 01:59 PM
What about the fixed point representation of a number?
11-18-2011 02:11 PM
Here is a FP Compare.vi that allows the precision ( number of digits) for comparison.
11-21-2011 10:16 AM
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!