Any implementation for the next method:
public static decimal StringToDecimal(string sValue)
{
if (string.IsNullOrEmpty(sValue))
{
return 0;
}
...
}
my app imports data from excel or dbf files from other machines, I have no problem reading string data, but I didn't succeded to read properly numeric data especially Price column. The source machine may use comma as decimal separator or any formatting.
decimal.Parse(...) or decimal.TryParse(...) works only if the string format of the numeric value matches the app machine settings.
CultureInfo.InvariantCultureto threat all numbers in a same (neutral) way.