c# round up to int code example
Example 1: c# round number
double number = 1.5362
int rounded = Math.Round(number)
double rounded_2 = Math.Round(number, 2)
Example 2: C# .net core convert to int round up
Math.Ceiling(0.5);
Math.Round(0.5, MidpointRounding.AwayFromZero);
Math.Floor(0.5);
Example 3: c# round up
double resultA = Math.Ceiling(1.02);
int resultB = Mathf.CeilToInt(1.02);
Example 4: c# round number up
double number = 1.5362
int ceiling = Math.Ceiling(number)
Example 5: round to int 32 c#
Convert.Toint64(number)