public static void Main()
string qd = "50.5439999";
Console.WriteLine(TruncateDigits(qd,3));
private static string TruncateDigits(string value, int places)
throw new InvalidOperationException("Places to shift must be greater then zero!");
decimal valueDecimal = Convert.ToDecimal(value);
if (Decimal.Round(valueDecimal, places) != valueDecimal)
var multiplier = (decimal)Math.Pow(10, places);
return (Math.Truncate(Convert.ToDecimal(value) * multiplier) / multiplier).ToString();