We use following code to convert a decimal to a string,
td_1.InnerText = String.Format("{0:C}", price)
so the result could be any of following cases:
4.83 -> $4.83
0 -> $0.00
-30.24 -> ($30.24)
my question is if there any way I can reverse the string back to a signed decimal? For example:
$4.83 ->4.83
($30.24) -> -30.24
I tried decimal.tryparse, doesn't seem work. Here is my code
decimal number;
if (Decimal.TryParse(price, out number) && number <0)
...