09-24-2014 10:56 AM
@RavensFan wrote:
One other comment about rounding. LabVIEW uses banker's rounding which takes any value that is dead on 0.5 and will round it to the nearest even integer. Generally in school we would have learned that 0.5 would be rounded up.
So nearest even integer may or may not be what you are looking for.
Don't forget to mention that banker's rounding is the industry standard and not just some arbitrary NI decision. 😉
09-24-2014 11:32 AM
Jeff,
what is the X value and what is the d value?
X would be number i want to round off to?
09-24-2014 11:39 AM - edited 09-24-2014 11:40 AM
@super_saiyans wrote:
Jeff,
what is the X value and what is the d value?
X would be number i want to round off to?
It you read the thread I linked you would see it is a LabVIEW implementation to duplicate the ROUND(X,d) function in Excel
This article describes the formula syntax and usage of the ROUND function in Microsoft Excel.
The ROUND function rounds a number to a specified number of digits. For example, if cell A1 contains 23.7825, and you want to round that value to two decimal places, you can use the following formula:
=ROUND(A1, 2)
The result of this function is 23.78.
ROUND(number, num_digits)
The ROUND function syntax has the following arguments:
09-24-2014 11:40 AM
i am having problem with this rounding off thing because i only want to look at certain points in my array
in this roundoff method..i have to select the whole array?
can you guys look at my code and sugguest a cleaner methold?
09-24-2014 11:40 AM
X is the number you want to round.
d is the power of 10 you want to round to. So to round to the nearest 0.1, but in -1. Round to the nearest 10, but in +1.
09-24-2014 12:14 PM - edited 09-24-2014 12:24 PM
nevermind..its my fault
the rounding methods are good!!!!!
09-24-2014 01:39 PM
I think you still should use Lynn's method that relies on the smallest difference of absolute values. This way is TOTALLY unambiguous and doesn't rely on someone's "best guess" which is what rounding really is.
05-21-2019 01:58 PM
smart. Thanks