407
Technology
26
.Net 5
23
.NET 6
23
Questions
15
Docker
12
Jobs
8
Machine-Learning
4
Education
4
Research
4
Software Development
3
Entity Framework
2
Art
2
Programming Music
2
General
2
Git
2
Hardware
2
IOT
1
JavaScript
1
Server
1
Tools
1
Writing
1
XML
1
SQL
1
System Design
1
Health
1
Home
1
Home Emprovements
1
Question
1
C-Sharp
1
Chrome
1
Algorithms
1
Front-End

**Question:** How do you Round Down the number to the nearest decimal point in C#? the number I want to round down is **0.7777777777777777771**, when I round use**Math.Round(MyNumber,02)** the answer is 0.78. I don't want this answer, I wanted 0.77.

How do you do that with Math.Round() Method?**Answer:** See the code below:

```
decimal myRoundDownValue = Math.Round(MyNumber,2,MidpointRounding.ToNegativeInfinity);
//Answer myRoundDownValue will be the actual value rounded to two decimal places.
```

Using the **Math.Round(MyNumber,2,MidpointRounding.ToNegativeInfinity);** will round down the value to two decimal places. According to Visual Studio Intellisense, the MidpointRounding.ToNegativeInfinity enum rounds down with the result closest to and no greater than the infinitely precise result.

Edit this Article

Math Round Down
Math.Round()
Round Down to nearest number
AspNet 6
ebook
e-book
Rounding Down to Nearest Integer
.NET 6
published

© 2021 - ErnesTech - Privacy