Round(417.504, 2, MidpointRounding.AwayFromZero)
Dim n As Double = 417.506 '<-- input number Dim a = Math.Round(n, 2) ' <--- will gives 417.51 Dim b = Math.Truncate(n * 100) / 100 ' <--- will gives 417.5 Dim c As Integer = Math.Ceiling(n) ' <--- will gives 418 Dim d = n.ToString("N2") ' <--- will gives 417.50
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)