Announcements
I have to round some field data with 2 decimal positions, when i run it in a job (client side), it just works as expected:
it works because, in this case, i want to get 110.03, that is the right number rounded.
But, when i try to use this one in a web service (server side), it just does not get rounded, i just get 110.02, instead of 110.03 (the right value). See the image:
See decRounded, the value is 110.025, and this rounded should be 110.03 instead of 110.02,
Is there a reason for this behavior?
*This post is locked for comments
docs.microsoft.com/.../system.math.round;view=netframework-4.7.2#System_Math_Round_System_Double_System_Int32_System_MidpointRounding_
I have to use System.Math.Round, to fix this behavior.
System.Math::Round(value,decimals,System.MidpointRounding::AwayFromZero)
The MidpointRounding::AwayFromZero was the trick.
André Arnaud de Cal...
294,000
Super User 2025 Season 1
Martin Dráb
232,850
Most Valuable Professional
nmaenpaa
101,158
Moderator