Quantcast
Channel: NI TestStand topics
Viewing all articles
Browse latest Browse all 6524

Rounding positive and negative numbers using the Round function

$
0
0

I am trying to round a calculated value. This value can be both positive and negative numbers. I want the posative numbers to round normally (at 0.5, round up to the nearest whole number) and negative numbers to work opposite (-25.5 rounds to -26) and I have not been able to figure it out. 

 

I have attached the current rounding code but when i get a value for locals.offset of -25.5, instead of rounding up (or down really) to -26, it rounds to -25. I understand why it would make sense for this to happen but I have not been able to get -25.5 to round to -26. Would somebody be able to help me out with this?


Viewing all articles
Browse latest Browse all 6524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>