' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Function xround(x As Double) As Double
   Dim xint As Long
   xint = 2 * x
   xround = xint / 2#
End Function

Function test()
   MsgBox Str(xround(2.2))
   MsgBox Str(xround(2.3))
   MsgBox Str(xround(2.7))
   MsgBox Str(xround(2.8))
End Function
