Visual Basic

2011-04-03 2:42 am
How to round off a number in Visual Basic 2010?

回答 (1)

2011-04-03 7:17 am
✔ 最佳答案
there is no function in vb that allow you to round a number you have to do it manually here is an example:

Function SRound(Real As Double) As Integer

Dim temp As Integer
temp=Val(Real)

If Real - temp >=0.5 Then
SRound=temp+1
Else
SRound=temp
End If
End Function


收錄日期: 2021-04-13 17:54:22
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20110402000051KK00899

檢視 Wayback Machine 備份