It seems that String.Format will not format the string as input. Am I doing something wrong, or is this just normal behavior?
Entrance: 0.37
This does not work.
string x = String.Format("{0:P}", myString)
Output: 0.37
It does.
string x = String.Format("{0:P}", Convert.ToDecimal(myString))
Yield: 37.00%
CodeMonkey1313
source share