Search code examples
asp.net-coreiiswindows-server-2019

String.Format changes to EU format when deployed to IIS


So I have a solution that I'm about to deploy to IIS. Currently, everything works fine in my debug environment, and my String.Format() for dollars is correct i.e.:

string.Format("{0:#,0.00}", myMoney)
//Outputs 100,00.00

However, when deployed to IIS things change slightly, here my strings with currency shows in an european format, i.e. 100.00,00...

I have tried a bunch of things thus far, without any luck, let me recap here:

  • Changed globalization in IIS from invariant to en_US in both Culture and UICulture
  • Changed region of the server to be US
  • Changed region of the client to be US

I'm running windows server 2019 with IIS 10.0.017763.1

Still, I'm stuck with the same problem. What have I missed?


Solution

  • Will other overloading method string.Format(cultureInfo,format,args) an option? In this case you can specify your desired culture.