using System;
public class Program
{
public static void Main()
decimal x = 1M;
int y = 7;
int d = 3;
decimal result = decimal.Round(x / y, d, MidpointRounding.ToZero);
Console.WriteLine(result); // outputs 0.142
}