When I tried to convert something like 0.1 (from user in textbox), My value b is always false.
bool b = Decimal.TryParse("0.1", out value);
How can it be here to work?
When I tried to convert something like 0.1 (from user in textbox), My value b is always false.
bool b = Decimal.TryParse("0.1", out value);
How can it be here to work?
Use
Culture
in overload methodSpecify the culture for the parsing. Your current culture uses some different number format, probably
0,1
.This will successfully parse the string:
Too late to the party, but I was going to suggest forcing the culuture to en-US but Invariant is a better sln