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.
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.