# How to round off the decimal value to 4 places in VB.NET [Answered]RSS

## 3 replies

Last post Feb 05, 2011 03:06 PM by kasimacsys

Member

468 Points

377 Posts

### How to round off the decimal value to 4 places in VB.NET

Aug 28, 2008 08:11 PM|fred51523|LINK

Iam getting the result ddlintresult as some 12.344444444444444444444

Dim ddlintresult As Decimal = Convert.ToDecimal(ddlint / lval)

How can i round off the values as 12.3445

Any suggestions or solutions are appreciated

Fred--Thats what my buddies call me

Contributor

7220 Points

2216 Posts

### Re: How to round off the decimal value to 4 places in VB.NET

http://msdn.microsoft.com/en-us/library/zy06z30k.aspx

Math.Round has overloads to do exactly this.

Member

468 Points

377 Posts

### Re: How to round off the decimal value to 4 places in VB.NET

Aug 28, 2008 08:21 PM|fred51523|LINK

Fred--Thats what my buddies call me

None

0 Points

2 Posts

### Re: How to round off the decimal value to 4 places in VB.NET

Feb 05, 2011 03:06 PM|kasimacsys|LINK

Hi,

Use  formatnumber(yourvalue,no.of decimal place)

ex: dim value as double=12.23434

formatnumber(value,2)

value=12.23

J.Kasim Mohamed
Programmer
Acsys IT Software Solution
Dubai.