try
try copied to clipboard
The current culture is CultureInfo.InvariantCulture instead of the user's culture
The current culture is CultureInfo.InvariantCulture instead of the user's culture
Description This is a regression. Before the Blazor migration, the current culture of the REPL was CultureInfo.InvariantCulture. This was changed to retrieve culture information from the user's browser. But with the Blazor migration, the current culture is once again the invariant culture.
This applies to code run interactively from docs.microsoft.com/dotnet; it does not apply to code run directly in try.dot.net.
Repro Run the first example in the Standard numeric format strings article. It formats the Decimal value 123.456 as a currency value. The example produces the following output:
¤123.46
Note that ¤ is the currency symbol for the invariant culture. We can also modify the example to see what the current culture is:
decimal value = 123.456m;
Console.WriteLine(value.ToString("C2"));
Console.WriteLine(System.Globalization.CultureInfo.CurrentCulture.DisplayName);
The output confirms that the current culture is the invariant culture:
¤123.46
Invariant Language (Invariant Country)
@LadyNaggaga can we prioritize this issue? Thanks!