Round-funktion [VBA]
Afrund-funktionen returnerer et tal afrundet til et specificeret antal decimaler.
Round( expression as Double [,numdecimalplaces as Integer] )
Double
udtryk: Påkrævet. Det numeriske udtryk der skal afrundes.
antaldecimaler: Valgfri. Specificerer hvor mange pladser til højre for decimalen, der skal medregnes i afrundingen. Standard er 0.
REM ***** BASIC *****
Option VBASupport 1
Sub Example_Round
Dim r
r = Pi
print r ' 3,14159265358979
print Round(r, 5) ' 3,14159
r = exp(1)
print r ' 2,71828182845904
print Round(r) ' 3
End Sub