public static void Main()
Console.WriteLine(Math.Round(num));
Console.WriteLine(RoundTo(num2,50, RoundType.Down));
private static int RoundTo(double num, int roundTo, RoundType roundType=RoundType.Default)
if (roundType == RoundType.Default)
return (int) Math.Round(num / roundTo) * roundTo;
if (roundType == RoundType.Down)
return (int) Math.Floor(num / roundTo) * roundTo;
if (roundType == RoundType.Up)
return (int) Math.Ceiling(num / roundTo) * roundTo;