locked
ASP.NET Development Server vs IIS localhost RRS feed

  • Question

  • User1111434469 posted

    Hi,

    On the same code, when i run my asp.net application on ASP.NET Development Server lists my double values as 154,35 and on my IIS localhost as 154.35. Why is that? How to change it? I'd like to have it as 154.35. In my code I use:

    Convert.ToDouble(Price1[x], System.Globalization.CultureInfo.CreateSpecificCulture("en-US"));

     

     

    Saturday, June 25, 2011 6:24 AM

Answers

  • User1111434469 posted

    I found the answer to the question. The easies thing (in WinXP) is to go to Control Panel -> "Date, Time, Language and Region Options" -> "Regional and Language Options" -> "Regional Options" tab -> Customize button -> Decimal symbol change from "," to ".".

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, April 15, 2012 6:54 AM

All replies

  • User1618479829 posted

    Please try the soultion mentioned in the below thread.

    http://bytes.com/topic/asp-net/answers/645374-problem-decimal-parse-cultureinfo

    Saturday, June 25, 2011 12:05 PM
  • User1111434469 posted

    No, it didn't help.

    Doing some more tests i recognized that the problem is not exactly as it was described first. The problem exist only on an application where i have an iframe and it's run on ASP.NET Development Server. The same thing on IIS is showing the values with dot ".", not with coma ",". Putting breakpoints the values into the DataSet.DataTable are correctly with dot. In this iframe i've got asp:ListView with Label controls.

    Any suggestion on that?

    Saturday, June 25, 2011 2:12 PM
  • User-276842610 posted

    Hi Digitborn.com

    Thanks for your post.

    Please try using System.Globalization.CultureInfo.CreateSpecificCulture("en-US").InvariantCulture

    http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.invariantculture.aspx

    Hope this helps, thanks.

    Tuesday, June 28, 2011 4:43 AM
  • User1111434469 posted

    How to use it? At the moment i have code like:

    System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo(System.Globalization.CultureInfo.CreateSpecificCulture("en").Name, false);
    
    DataRow dr = this._fResults.Tables[0].NewRow();
    dr[0] = Convert.ToDouble(obj.Price1[x], ci.NumberFormat);

     

     

    Tuesday, June 28, 2011 5:41 AM
  • User1111434469 posted

    I found the answer to the question. The easies thing (in WinXP) is to go to Control Panel -> "Date, Time, Language and Region Options" -> "Regional and Language Options" -> "Regional Options" tab -> Customize button -> Decimal symbol change from "," to ".".

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, April 15, 2012 6:54 AM