Convert string to 2 decimal place
c#
Solution
var probablyDecimalString = "0.4351242134";
decimal value;
if (Decimal.TryParse(probablyDecimalString , out value))
Console.WriteLine ( value.ToString("0.##") );
else
Console.WriteLine ("not a Decimal");
Problem
I have a string (confirm to be of decimal expression) 0.4351242134 I want to convert to a string with two decimal place 0.44 How should I do in C#?