I have the number 12.1799999 and it should become 12.17 How does it work in c#?
Asked
Active
Viewed 115 times
0
-
If you intent to round down, then use `Math.Floor(number)` – Steven Sep 19 '22 at 08:39
-
but if i use it the number becomes 12 – Ostap Filipenko Sep 19 '22 at 08:39
2 Answers
0
If you intent to round down, then use Math.Floor(number, amountOfDecimals)
amountOfDecimals
should be 2 in your case

Steven
- 1,996
- 3
- 22
- 33
-
-
-
I see, I thought `Math.Floor()` had a decimal overload, like `Math.Round()` – Steven Sep 19 '22 at 09:36