So i have this input: 3,000,000
And this function return 30000M
:
public static decimal? CustomParse(string incomingValue)
{
decimal val;
if (!decimal.TryParse(incomingValue.Replace(",", "").Replace(".", ""), NumberStyles.Number, CultureInfo.InvariantCulture, out val))
return null;
return val / 100;
}
What the best way to convert this kind on input to numbber
?
EDIT
I also try this::
Regex regex = new Regex(@"\d+");
And the output is 3