' 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) 
Module Program
    Sub Main()
        Dim x As Decimal
        x = 1.4
        Console.WriteLine(Math.Round(x, 0, MidpointRounding.AwayFromZero))
        x = 1.5
        Console.WriteLine(Math.Round(x, 0, MidpointRounding.AwayFromZero))
        x = 1.6
        Console.WriteLine(Math.Round(x, 0, MidpointRounding.AwayFromZero))
        x = 2.4
        Console.WriteLine(Math.Round(x, 0, MidpointRounding.AwayFromZero))
        x = 2.5
        Console.WriteLine(Math.Round(x, 0, MidpointRounding.AwayFromZero))
        x = 2.6
        Console.WriteLine(Math.Round(x, 0, MidpointRounding.AwayFromZero))
    End Sub
End Module
