-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed as not planned
Labels
Description
Description
As title says Math.Round fails to round 0.50 values be it decimal or double data typed, it rounds these values but returns lower values rather than it should add value 1.
For Ex. if I have to round 99.50 and put Math.Round around it then it will return 99 whereas it should return 100.
Reason: in Excel and in SQL server too its returned 100.


Reproduction Steps
Math.Round(99.50M, 0) // 100 is expected.
Math.Round(99.49M, 0) // 99 is expected and is Okey.
Math.Round(99.51M, 0) // 10 is expected and is Okey.
Expected behavior
Math.Round(99.50M, 0) // 100 is expected.
Actual behavior
Math.Round(99.50M, 0) // 99 is return
Regression?
No response
Known Workarounds
having to write logic for exact 0.50 values while rounding values
Configuration
VS22 Community version along side .Net7, on Win11
Other information
No response
Reactions are currently unavailable