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. Culture extrange behavior

Culture extrange behavior

Scheduled Pinned Locked Moved C#
helpquestionworkspace
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.
  • J Offline
    J Offline
    Jose Vicente
    wrote on last edited by
    #1

    Hello all. I have a extrange behavior in my computer. My regional configuration is Spanish ( Spain ) which means that the local decimal separator is ','. If I run this code the results are double d = 5.1; string s = d.ToString (); //s= "5.1" which is not the expected result ( it must be "5,1"). I have checked the value of System.Threading.Thread.CurrentThread.CurrentCulture and the culture is spanish-spain and the currency decimal separator is ','. But the most extrang thing is that I have gone to the control panel, I have changed the local configuration to Catalonian, then without close the dialog I have changed another time to Spanish-Spain and after that the previous code works and the double is translated to "5,1". Anyone have some similar problems ? Is this a bug of the framework. Can anyone help me ? :confused: Best regards Jose Vicente

    N 1 Reply Last reply
    0
    • J Jose Vicente

      Hello all. I have a extrange behavior in my computer. My regional configuration is Spanish ( Spain ) which means that the local decimal separator is ','. If I run this code the results are double d = 5.1; string s = d.ToString (); //s= "5.1" which is not the expected result ( it must be "5,1"). I have checked the value of System.Threading.Thread.CurrentThread.CurrentCulture and the culture is spanish-spain and the currency decimal separator is ','. But the most extrang thing is that I have gone to the control panel, I have changed the local configuration to Catalonian, then without close the dialog I have changed another time to Spanish-Spain and after that the previous code works and the double is translated to "5,1". Anyone have some similar problems ? Is this a bug of the framework. Can anyone help me ? :confused: Best regards Jose Vicente

      N Offline
      N Offline
      Norman Timo
      wrote on last edited by
      #2

      I think that problem can be solved in Windows. There are possibilities to change culture-settings in "control panel" -> "regional settings" -> "numbers" (At least Win2000). There are many settings which you can change. Perhaps is Windows meaning that i Spain the standard seperator is '.'? Try this and hope that this works... If not, I´m sorry to reply this question, and forgot everything I wrote ;-) Ciao Norman-Timo

      J 1 Reply Last reply
      0
      • N Norman Timo

        I think that problem can be solved in Windows. There are possibilities to change culture-settings in "control panel" -> "regional settings" -> "numbers" (At least Win2000). There are many settings which you can change. Perhaps is Windows meaning that i Spain the standard seperator is '.'? Try this and hope that this works... If not, I´m sorry to reply this question, and forgot everything I wrote ;-) Ciao Norman-Timo

        J Offline
        J Offline
        Jose Vicente
        wrote on last edited by
        #3

        Thanks.

        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