APPS:C# convert double to string in different regional language give different output

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • y2ktan
    New Member
    • Feb 2008
    • 6

    APPS:C# convert double to string in different regional language give different output

    Hi Ladies and Gentlements,

    I have a variable with the type of double. Let said that it is 0.003.
    Code:
    double dblValue = 0.003
    Now, when I want to convert it to string with the local regional language set to US English .
    The output value is 0.003

    This is correct and fine

    However, when I convert the double to string with the local regional language set to France.
    The output value is 0,003

    The point has became comma and this is boggling me.

    The questions here are, why the conversion in France and US English give the different result? And how can we solve the problem so that the conversion from double to string can behave correctly in different regional languages?

    Thanks and have a nice day.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    It's the same result. France uses the , (comma) as it's seperator not the . (period)
    That would be the point of usuing regional settings, so they would understand the output.
    If you REALLY need it to ALWAYS use the english version, use one of the .ToString() overrides that allows to specify the region and pick the english one

    Comment

    Working...