Convert string currency value to decimal value

Filed in .Net Leave a comment

public static decimal ConvertCurrencyToDecimal(string Value)

{

if (Value == “$0.00″)

return 0;

else if (Value.Length == 0)

return 0;

else

return Decimal.Parse(Value.Replace(” “, “”), NumberStyles.Any | NumberStyles.AllowCurrencySymbol | NumberStyles.AllowThousands | NumberStyles.AllowDecimalPoint, new CultureInfo(“en-US”));

}

TOP