Home > .Net > Convert string currency value to decimal value

Convert string currency value to decimal value

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”));

}

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Trackbacks:0

Listed below are links to weblogs that reference
Convert string currency value to decimal value from extremeweblog.com
TOP