Formula In A Code Block


#1

Hello

I’m new to Dynamo. Could someone show me the following formula (used to round a number to the nearest 5 units) in a code block?

Dim negative As Boolean
Dim i As Integer

If Number < 0 Then

negative = True

Number = Number - (Number * 2)
End If
If Not Number = 0 Then
Number = Number / 5
i = CType(Number, Integer)
i = i * 5
Else
i = 0
End If
If negative Then i = i - (2 * i)

Thanks