I am getting a decimal field from the database say 45.693043. I want to convert it to String and then format it to 4 decimal places . I was originally doing like this
string interestRate = ds.Tables[0].Rows[i]["IntR
ate"].ToSt
ring().Tri
m();
string intRate = String.Format("{0:0.0000}"
, interestRate );
I have tried String.Format("{0:F2}", interestRate ); and N2 ...did not work ...keeps me the original string...
Start Free Trial