how to round whole numbers to add a .0 in c# code example
Example 1: C# .net core convert to int round up
Math.Ceiling(0.5);
Math.Round(0.5, MidpointRounding.AwayFromZero);
Math.Floor(0.5);
Example 2: round to the nearest whole number c#
var roundedA = Math.Round(1.1, 0);
var roundedB = Math.Round(1.5, 0, MidpointRounding.AwayFromZero);
var roundedC = Math.Round(1.9, 0);
var roundedD = Math.Round(2.5, 0);
var roundedE = Math.Round(2.5, 0, MidpointRounding.AwayFromZero);
var roundedF = Math.Round(3.49, 0, MidpointRounding.AwayFromZero);