Click to See Complete Forum and Search --> : VB6 code to vb .net ....


rajtofar
June 8th, 2002, 08:51 AM
hi,
this is a code in vb6 to round off a number...
can someone give a code to round of the decimals in vb.net???
Pl. help.


Public Sub roundnumber(ByRef roundn, ByVal Decimals As Integer)
On Error Resume Next
Dim roundamount As Single, result
roundamount = 10 ^ Decimals
result = (CLng((roundn) * roundamount) / roundamount)
roundn = result

End Sub


Thanks in advance.

Iouri
June 9th, 2002, 10:07 AM
Write it in VB6 and then open project in VB.NET and run the wizard to convert