Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6640873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:44:42+00:00 2026-05-25T23:44:42+00:00

public static decimal Round( decimal d, int decimals ) The decimals parameter specifies the

  • 0
   public static decimal Round(
decimal d,
int decimals
    )

The decimals parameter specifies the number of fractional digits in the return value and ranges from 0 to 28. If decimals is zero, an integer is returned.

If the value of the first digit in d to the right of the decimals decimal position is 5, the digit in the decimals position is rounded up if it is odd, or left unchanged if it is even. If the precision of d is less than decimals, d is returned unchanged.

    Math.Round(3.44, 1); //Returns 3.4.
   Math.Round(3.45, 1); //Returns 3.4.

Why 3.45 is returning 3.4..I am unable to understand this output.Can anyone help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:44:43+00:00Added an answer on May 25, 2026 at 11:44 pm

    You can change this behaviour by using the Round overload which take the MidpointRounding parameter, from MSDN:

    ToEven (default, AKA Bankers Rounding) When a number is halfway between two others, it is rounded toward the nearest even number.
    AwayFromZero When a number is halfway between two others, it is rounded toward the nearest number that is away from zero.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm calling the below method with 0.02 public static string FormatAsDecimalWithCommaSeperator(decimal value) { return
public static string RatingCalculator(int input) { if (input < 10) { return string.Empty; }
public static void main(String[] args) { int i = 0; while(i==0){ System.out.println(Possibilities: R, T,
public static string GetCurrentEmployeeName() { return db.Employees.SingleOrDefault( c => c.NTUserName == CurrentUsername() ).Last_First; }
public class MySingletonClass { private static MySingletonClass mySingletonClass; private const decimal someDiscount = 3.00M;
here is sample code public static decimal factorization(decimal num, decimal factor) { if (num
I have a class method: public static class ProductExtensions { public static decimal GetPrice(this
I have a simple C# function: public static double Floor(double value, double step) {
private static int reverse(int n, int r) { if (n == 0) return r;
I have the following extension method public static bool IsValidCurrency(this string value) { CultureInfo

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.