title: Set CultureInfo in Asp.net Core to have a . as CurrencyDecimalSeparator instead of ,
body: <p>I'm going mad. I just want the culture used in the entire Asp.net core application to be set to "en-US". But nothing seems to work. Where to I set the culture for the entire application? I'm not interested in client browser cultures and what not. The only thing that seems to change it is changing the language settings of Windows. I just want the culture to be determined from within the application itself, not by the client.</p>
  
  <p>What I have tried so far:</p>
  
  <ul>
  <li>Set <code>&lt;system.web&gt;&lt;globalization uiCulture="en" culture="en-US" /&gt;&lt;/system.web&gt;</code> in web.config</li>
  <li>Set <code>System.Threading.Thread.CurrentThread.CurrentCulture = cultureInfo;</code> and <code>CurrentUICulture</code> in Startup.Configure and even in the controller.</li>
  <li><p>Use <code>app.UseRequestLocalization(..</code> as shown below</p>
  
  <pre><code>    var enUsCulture = new CultureInfo("en-US");
      var localizationOptions = new RequestLocalizationOptions()
      {
          SupportedCultures = new List&lt;CultureInfo&gt;()
          {
              enUsCulture
          },
          SupportedUICultures = new List&lt;CultureInfo&gt;()
          {
              enUsCulture
          },
          DefaultRequestCulture = new RequestCulture(enUsCulture),
          FallBackToParentCultures = false,
          FallBackToParentUICultures = false,
          RequestCultureProviders = null
      };
  
      app.UseRequestLocalization(localizationOptions);
  </code></pre></li>
  </ul>
  
  <p>But nothing seems to change the CurrencyDecimalSeparator from (nl-NL) , to (en-US).</p>
  
  <p>How can the culture be set?</p>
  
  <p><strong>EDIT:</strong>
  @soren
  This is how the configure method looks like. I've put a breakpoint on <code>DetermineProviderCultureResult</code> but it is never hit while visiting the website.</p>
  
  <pre><code>public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, FinOsDbContext context)
      {
          loggerFactory.AddConsole(Configuration.GetSection("Logging"));
          loggerFactory.AddDebug();
  
          if (env.IsDevelopment())
          {
              app.UseDeveloperExceptionPage();
              app.UseDatabaseErrorPage();
              app.UseBrowserLink();
          }
          else
          {
              app.UseExceptionHandler("/Home/Error");
          }
  
          app.UseStaticFiles();
  
          app.UseIdentity();
  
          // Add external authentication middleware below. To configure them please see http://go.microsoft.com/fwlink/?LinkID=532715
  
          app.UseMvc(routes =&gt;
          {
              routes.MapRoute(
                  name: "default",
                  template: "{controller=Home}/{action=Index}/{id?}");
          });
  
          //TODO: Clean up
          //var cultureInfo = new CultureInfo("en-US");
          //System.Threading.Thread.CurrentThread.CurrentCulture = cultureInfo;
          //System.Threading.Thread.CurrentThread.CurrentUICulture = cultureInfo;
  
          app.UseRequestLocalization();
  
          // UseCookieAuthentication..
          // UseJwtBearerAuthentication..
  
          //add userculture provider for authenticated user
          var requestOpt = new RequestLocalizationOptions();
          requestOpt.SupportedCultures = new List&lt;CultureInfo&gt;
          {
              new CultureInfo("en-US")
          };
          requestOpt.SupportedUICultures = new List&lt;CultureInfo&gt;
          {
              new CultureInfo("en-US")
          };
          requestOpt.RequestCultureProviders.Clear();
          requestOpt.RequestCultureProviders.Add(new SingleCultureProvider());
  
          app.UseRequestLocalization(requestOpt);
  
          FinOsDbContext.Initialize(context);
          FinOsDbContext.CreateTestData(context);
      }
  
      public class SingleCultureProvider : IRequestCultureProvider
      {
          public Task&lt;ProviderCultureResult&gt; DetermineProviderCultureResult(HttpContext httpContext)
          {
              return Task.Run(() =&gt; new ProviderCultureResult("en-US", "en-US"));
          }
      }
  </code></pre>