From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Rounding up and Rounding Down numbers

How would round up any numbers or round down numbers in labview ?
For example.  5.25 rounded down to 5, 5.35 rounded down to 5, 5.75 rounded to 5.5, and 5.75 rounded to 6.0.   So if > 0.25 rounded to zero, > 0.25 and < 0.5 rounded to 0.5  or if >0.5  and < 0.75 rounded to 0.5 and if > 0.75 and < 1.0 rounded to 1.
 
 
0 Kudos
Message 1 of 3
(3,131 Views)
Hi Lagahoo,

I'm not sure if I understand exactly what you're after, but I'll give it a go!

The code shown below will round a number to the nearest 0.5. It doubles the number, rounds it to the nearest whole integer and halves it again. If this isn't what you were after, please let me know. Some of your statements contradicted each other so I'm not sure about your original question.

Hope this helps!




Message Edited by Tom O on 01-24-2008 10:50 AM
Tom

Applications Engineering, NI UK
0 Kudos
Message 2 of 3
(3,109 Views)
Thanks very much for your help.   I am sorry about the contradiction in my question.
0 Kudos
Message 3 of 3
(3,069 Views)