Home > Articles > Details

# Rounding Down to the Nearest Decimal Point in C-Sharp (AspNet 6)

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?

Login to See the Rest of the Answer

See the code below:

``````decimal myRoundDownValue = Math.Round(MyNumber,2,MidpointRounding.ToNegativeInfinity);
//

Write an Article

``````
``` #Math Round Down #Math.Round() #Round Down to nearest number #AspNet 6 #ebook #e-book #Rounding Down to Nearest Integer #programming tools .Net 7 published Written By: Ernes SoftwareDeveloper ```
``` Notify Me of New Posts We Recieved Your Request. Thank you. We'll never share your email with anyone else. You Liked This Article function completed(xrh) { \$('#panel').show(); \$('#formHide').hide(); } function likeComplete() { \$('#articleLiked').modal('show'); } \$(document).ready( function () { \$('#panel').hide(); \$(".modale_opener").click(function () { \$('#exampleModalCenter').modal('show'); }); }); No Login Required! If you log in, you will be notified when someone leaves a comment. Other users would like to know if this solution helped you. Hy said: If you want to get a positive number from a subtraction in C sharp just use Decimals and absolute values. Posted On: March 02, 2022 13:30:03 PM Could not copy the file to the destination file be .NET 7     Likes 0 Views 0 Could not copy the file to the destination file because the destination is a folder instead of a file. To copy the source file into a folder, consider using the DestinationFolder parameter instead of DestinationFiles .NET 7    Likes: 0 System.IO.FileNotFoundException: Could not load fi .NET 7     Likes 0 Views 0 System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral .NET 7    Likes: 0 Error NU1107 Version conflict detected for Microso .NET 7     Likes 0 Views 0 Error NU1107 Version conflict detected for Microsoft.CodeAnalysis.Common. Install/reference Microsoft.CodeAnalysis.Common 3.8.0 directly to project Name to resolve this issue .NET 7    Likes: 0 ```
``` ```
``` ```
``` ```
``` ```
``` #myBtn { display: none; position: fixed; bottom: 20px; right: 30px; z-index: 99; border: none; outline: none; background-color: red; color: white; cursor: pointer; padding: 15px; border-radius: 10px; font-size: 18px; } #myBtn:hover { background-color: #555; } window.onscroll = function () { scrollFunction() }; function scrollFunction() { if (document.body.scrollTop > 1000 || document.documentElement.scrollTop > 1000) { document.getElementById("myBtn").style.display = "block"; return false; } else { document.getElementById("myBtn").style.display = "none"; return false; } } function topFunction() { document.body.scrollTop = 0; document.documentElement.scrollTop = 0; return false; } © 2022 - ErnesTech - Privacy English (United States) Spanish (Spain) French (France) Portuguese (Brazil) Chinese (China) Turkish (Turkey) German (Germany) Jobs Search News Articles Videos Shop Sign Up Login Grid-Method Tools PDF to HTML Converter Forums How Can We Improve this Site? 2 + 4 = function completed(xrh) { \$("#panel").show(); \$("#formHide").hide(); \$("#survey").modal("hide"); } \$(document).ready( function () { \$("#panel").hide(); \$(".modal_survey").click(function () { \$("#survey").modal("show"); }); }); ```