Round function - Rounding 1.165 to 2 decimal places results in 1.16, not 1.17. Rounding 1.15 to 1 decimal place results in 1.2. (2 replies)
Catalyst, IMan follows bankers rounding (as discussed in the following two posts).
https://stackoverflow.com/questions/311696/why-does-net-use-bankers-rounding-as-default
https://blogs.msdn.microsoft.com/ericlippert/2003/09/26/bankers-rounding/
Thank you.
Hi all,
I've just noticed an issue with rounding that's causing a lot of trouble for a customer I'm working with. If anyone can assist / get back to me, it would be greatly appreciated.
Before I describe the issue, I wanted to list the version details:
Assembly Versions:
Realisable.IManWebUI.DLL 3.2.0.0
Product Update: PU1
Config Version: 3.21
DB Version: 3.12
The issue is relatively simple to describe. I'm trying to use the Round function on a decimal datatype field. Specifically, I need to round the decimal value to 2 decimal places.
When I use Round like so, the output is 1.16:
Is there a reason why it's not 1.17? The 5 should round up.
I've tested another example to see if it will always round the 5 down, but I've ran into an interesting result.
If I run the following code, I get 1.12 as my output:
Is there a reason why my second example rounds up the 5 as intended and my first example does not? Is this a known bug?
Is there any way I can force the function to always round up on 5?
On the support page it shows there are only 2 parameters to this function, so I didn't see anything else I can pass to the function to help.