String to Currency {0:C} UICulture Culture KES, ASP.NET , , culuture.
Note: You can change the culture by changing the culture of the browser (you can do this for development purposes), but best practice changes the culture programmatically, for example, here I change the culture to the user. Cookie and mu default culture is en-us like this.
protected override void InitializeCulture()
{
HttpCookie cultureCookie = Request.Cookies["culture"];
if (cultureCookie == null)
{
cultureCookie = new HttpCookie("culture", "en-US");
Response.Cookies.Add(cultureCookie);
}
Thread.CurrentThread.CurrentCulture = new CultureInfo(cultureCookie.Value);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(cultureCookie.Value);
base.InitializeCulture();
}
source
share