LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to round with decimals in labview?

Permit me to apologize, my reference to labview's round-off error was submitted primarily out of frustration with the offending functions.

I'm aware of numerical errors inherent to computers. I should've stated that I would have expected the source-code represented by the GUI functions to have corrected for this known issue.

This is a discussion forum for resolving problems. My generalized verbal display of irritation should not have been aired here. In addition, personal insults pertaining to 101 classes also have no place here.

Apparently I'm not the only one with lapses in judgement.
Message 11 of 41
(7,166 Views)
Just curious, why attach password protected vi?
I was curious to see if you had another solution than the others above...
Message 12 of 41
(6,911 Views)
Oops...! Sorry about that...
Here's the vi.

Cheers!
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
Message 13 of 41
(6,911 Views)
Very handy. Thanks!
0 Kudos
Message 14 of 41
(6,911 Views)

Has anyone found a real solution to this?

 

I'm having issues with this also.

 

 

In vb.net all I had to do was    round.decimal(myNumber,2)  and this would be fine and simple.

 

example the above code would return:  2.6972     would return 2.70   with no trailing zeros.

 

i'm very new to labview and i'm surprised this function can not be found.

 

Thanks

JCollado
Message 15 of 41
(6,537 Views)

Did you try the VI that Ian posted?

 

Here is what is inside (with the formula node replaced with a LV primitive).

Message Edited by Ravens Fan on 10-05-2009 02:35 PM
Message 16 of 41
(6,519 Views)

 

 

Ok Yes.

 

Thank you.

 

Since I saw that it was still leaving the trailing zeros I thought it was not yet perfect but it is working fine when the indicator does not have minimum decimal requirements.

 

Thank you

JCollado
0 Kudos
Message 17 of 41
(6,512 Views)

Hello! 🙂 Thank you for the attached VI. I would just like to ask if the number of entries is limited to 15? As in 15 rows in the csv file? Thank you very much! 🙂

0 Kudos
Message 18 of 41
(5,863 Views)

Please disregard my previous reply to you. Thank you! 😄

0 Kudos
Message 19 of 41
(5,856 Views)

I have modify the vi to avoid the problem with the rounded number that goes to the next higher. It's working for me, but...

 

I do it in a bigger program that I compare the result with a data i have. but if i use 0.25 both number suposse to be the same but the compare result is FALSE, and in the Probe Wathc windows both appears like 0.25 it seems extrage.

 

Any help?

 

Thank you

 

I think i have already solve it, by converting the data to single. Thank you anyway!

0 Kudos
Message 20 of 41
(5,457 Views)