public static void Main()
decimal officialPrice = 16.80251m;
Console.WriteLine(RoundThridDecimalToDivisibleByFive(officialPrice));
Console.WriteLine(0m/00.5m);
public static decimal RoundThridDecimalToDivisibleByFive(decimal value)
if(value == default(decimal))
var roundedValue = value / 0.005m;
decimal decimalpoints = Math.Abs(roundedValue - Math.Floor(roundedValue));
if (decimalpoints > 0.5m)
absoluteValue = (int)Math.Round(roundedValue);
absoluteValue = (int)Math.Floor(roundedValue);
return absoluteValue * 0.005m;