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. .NET (Core and Framework)
  4. visual studio thinks it resides in Europe, and we're actually in the US

visual studio thinks it resides in Europe, and we're actually in the US

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpquestionvisual-studiocom
4 Posts 3 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.
  • M Offline
    M Offline
    Mihai Pruna
    wrote on last edited by
    #1

    So I'm coding in .NET (C#), under Visual Studio, and getting some numbers in string format and converting them to double.Parse to doubles. However, it only works if the number strings first have the . replaced with a , How can I make the double.parse command give me decimals delimited with dots , not commas?

    Codes for Scientists and Engineers

    N O 2 Replies Last reply
    0
    • M Mihai Pruna

      So I'm coding in .NET (C#), under Visual Studio, and getting some numbers in string format and converting them to double.Parse to doubles. However, it only works if the number strings first have the . replaced with a , How can I make the double.parse command give me decimals delimited with dots , not commas?

      Codes for Scientists and Engineers

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      Have you checked setting for the local computer? In Vista the formatting is set in the Regional and Language options dialog from the control panel


      only two letters away from being an asset

      M 1 Reply Last reply
      0
      • N Not Active

        Have you checked setting for the local computer? In Vista the formatting is set in the Regional and Language options dialog from the control panel


        only two letters away from being an asset

        M Offline
        M Offline
        Mihai Pruna
        wrote on last edited by
        #3

        Thanks, good idea, however, I just checked and the decimal separator is already defined as the dot.

        Codes for Scientists and Engineers

        1 Reply Last reply
        0
        • M Mihai Pruna

          So I'm coding in .NET (C#), under Visual Studio, and getting some numbers in string format and converting them to double.Parse to doubles. However, it only works if the number strings first have the . replaced with a , How can I make the double.parse command give me decimals delimited with dots , not commas?

          Codes for Scientists and Engineers

          O Offline
          O Offline
          omlac
          wrote on last edited by
          #4

          use this: double dummyOut = new double(); System.Globalization.CultureInfo cultureInfo = new System.Globalization.CultureInfo("en-US", true); Double.TryParse(anyString, System.Globalization.NumberStyles.Any, cultureInfo.NumberFormat, out dummyOut); }

          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