Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Euros and decimal.Parse

Euros and decimal.Parse

Scheduled Pinned Locked Moved C#
csharpvisual-studioquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Simon_uk
    wrote on last edited by
    #1

    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.

    S 1 Reply Last reply
    0
    • S Simon_uk

      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.

      S Offline
      S Offline
      Simon_uk
      wrote on last edited by
      #2

      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.

      M 1 Reply Last reply
      0
      • S Simon_uk

        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.

        M Offline
        M Offline
        Member 96
        wrote on last edited by
        #3

        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).

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups