I need to set “0” at the end of the decimal place dynamically if less integer number found after decimal place.
Suppose we have value: “535.8” Now I need to set it as “535.800” I have following code:
string cost = "535.8";
string decplace = "3";
decimal price = decimal.Round(Convert.ToDecimal(cost), Convert.ToInt32(decplace));
Console.WriteLine(price);
Console.ReadLine();
Unable to get 535.800.
How can I achieve this?