How to Round a value to a specified number of digits in VB .NET

No.of Views691
Bookmarked0 times
Downloads 
Votes0
By  RRaveen   On  12 May 2010 20:05:25
Tag : VB.NET , Miscellaneous
How to Round a value to a specified number of digits in VB .NET
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Introduction

The Math.Round method takes two parameters giving the number to round and the number of digits you want to round at.

Imports System.Math

Public Class Utlities

    Private Shared Function GetRound(ByVal amount As Double, ByVal digits As Integer) As Double
        Return Round(amount, digits)
    End Function

End Class

Here  the first arguments the  value of rounding and second argument is now of digits would round.

How  to Use Above Method

Utlities.GetRound(args1,args2)

Note:If you are going to use the Round Function , you have to import the System.Math namespace in your project.enjoy.

 
Sign Up to vote for this article
 
About Author
 
RRaveen
Occupation-Software Engineer
Company-TGS
Member Type-Gold
Location-Singapore
Joined date-03 Jun 2009
Home Page-codegain.com
Blog Page-www.codegain.com
- B.Sc. degree in Computer Science. - 4+ years experience in Visual C#.net and VB.net - Obsessed in OOP style design and programming. - Designing and developing Network security tools. - Designing and developing a client/server application for sharing files among users in a way other than FTP protocol. - Designing and implementing GSM gateway applications and bulk messaging. - Windows Mobile and Symbian Programming - Having knowledge with ERP solutions
 
 
Other popularSectionarticles
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top