C# code problem while working in Dutch locale

Discussion in 'C#' started by Leo, Aug 24, 2007.

  1. Leo

    Leo New Member

    Joined:
    Nov 10, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    0
    I have an application that runs in English and Dutch locale.

    I have a dataset that retrieves decimal values from the database.I use that data and convert them to Double value and display in my report.

    e.g: i have a value say 150.89 in the database.Once that is retrieved from the database in to the dataset , the value is stored as 150,89 in the dataset. And once i try to convert 150,89 to double the value becomes 15089.

    I think if i can preserve the value as 150.89 and then when i convert to double , it will become 150,89.

    Please help me in this.
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    You should be checking the decimal character of the locale and in some locale its ,

    Now actual test case should be when you have the data entered in the locale should be consistent.
     
  3. Leo

    Leo New Member

    Joined:
    Nov 10, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    0
    How can i check what is the current locale i am running my application.
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Using the CultureInfo class.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice