CultureInfo culture = new CultureInfo("en-US");
culture.DateTimeFormat.DateSeparator = "/";
culture.DateTimeFormat.ShortDatePattern = "dd/MM/yyyy";
//dekadikoi arithmoi
culture.NumberFormat.NumberDecimalSeparator = ".";
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = culture;
As it is required to work that way everywhere! The problem is that doing new CultureInfo("en-US");
all other computer-specific settings are omited...
Is there a way to copy the CurrentCulture?
I tried to modify currentculture but i got read only error...
CultureInfo culture = (CultureInfo)CultureInfo.CurrentCulture.Clone();
culture.DateTimeFormat.DateSeparator = "/";
culture.DateTimeFormat.ShortDatePattern = "dd/MM/yyyy";
//dekadikoi arithmoi
culture.NumberFormat.NumberDecimalSeparator = ".";
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = culture;
You may wish to use:
CultureInfo culture = (CultureInfo)CultureInfo.CurrentUICulture.Clone();
instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With