Resources » Code Snippets » ASP.NET WebForms

How to Round of Float values

Updated: Category: ASP.NET WebForms
Author: Member Level: GoldPoints: 10

The following code sample shows how to round off float values. It takes 2 parameters one is the double value,second parameter specifies after how many digts it should be rounded

Math.Round(0.8993333, 2)

Did you like this resource? Share it with your friends and show your love!

Responses to "How to Round of Float values"
Author: Programmer  20 May 2008   Member Level: Gold   Points : 2
Math.Round is a function which available in both and javascript.The difference is that in javascript it does not accepts second parameter and converts it into round figure.
For eg,
Math.round(25.9) //returns 26

Author: vivek kushwaha  21 May 2008   Member Level: Silver   Points : 2
check this one.


Post 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:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)

    Type the numbers and letters shown on the left.

    Submit Article     Return to Article Index
    Subscribe to Subscribers
    Active Members
    TodayLast 7 Daysmore...

    Awards & Gifts
    Talk to Webmaster Tony John
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India