Euros and decimal.Parse
-
Hello all, I'm having a bit of trouble with decimal.Parse. I am trying to convert a currency string into a decimal number. This is my code...
decimal theValue = decimal.Parse(strValue, NumberStyles.Currency);
This works fine for string values such as "£1.23" or "$4.56", ;) but throws an invalid input exception if i try it with "€9.87". :(( I'm using VS.NET 2002 (1.0 framework), does anyone know if this works with euro's in 2003 (1.1)?? If so then i'll upgrade to that, if not has anyone got a workaround? Thanks in advance, Simon. -
Hello all, I'm having a bit of trouble with decimal.Parse. I am trying to convert a currency string into a decimal number. This is my code...
decimal theValue = decimal.Parse(strValue, NumberStyles.Currency);
This works fine for string values such as "£1.23" or "$4.56", ;) but throws an invalid input exception if i try it with "€9.87". :(( I'm using VS.NET 2002 (1.0 framework), does anyone know if this works with euro's in 2003 (1.1)?? If so then i'll upgrade to that, if not has anyone got a workaround? Thanks in advance, Simon. -
Simon_uk wrote: I'm using VS.NET 2002 (1.0 framework), does anyone know if this works with euro's in 2003 (1.1)?? If anyone cares, then this is still a problem in the 1.1 framework so you have to deal with Euro's manually. :doh: Simon.
Simon_uk wrote: If anyone cares, then this is still a problem in the 1.1 framework so you have to deal with Euro's manually. I care very much, what is the exact problem? Some sort of bug or... I'm about to port (re-write actually) a 400,000+ lines of code c++ program to c# that will definitely be parsing user entry of Euro values (not to mention pesos, kroners etc etc).