RoundOff in ASP.NET C#


Roundoff values using ASP.NET C#,with the help of math function of c#

Roundoff values in ASP.NET C#


Hi friends,

//if you have value 12.27874 and you want 12.28 then
//use Math.Round function





double num = 12.27874;
Response.Write(Math.Round(num, 2));



you will get 12.28

// if you want 12.279 then



Math.Round(num, 3);



you will get 12.279


Related Articles

Round off in ASP.NET

RoundOff the Values in ASP.NET C# , if you want rounded value so you use the C# function (Round)

More articles: Round Off Rounding Off Decimals Rounding Math Round

Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: