Commit 00acc1fb authored by Clint.Network's avatar Clint.Network

Trying to Fix ¤ Problem

parent fda768c3
...@@ -36,8 +36,6 @@ namespace Stratis.Guru.Controllers ...@@ -36,8 +36,6 @@ namespace Stratis.Guru.Controllers
{ {
var rqf = Request.HttpContext.Features.Get<IRequestCultureFeature>(); var rqf = Request.HttpContext.Features.Get<IRequestCultureFeature>();
Console.WriteLine(JsonConvert.SerializeObject(rqf.RequestCulture.Culture.NumberFormat, Formatting.Indented));
double displayPrice = 0; double displayPrice = 0;
double last24Change = 0; double last24Change = 0;
......
...@@ -29,6 +29,7 @@ namespace Stratis.Guru ...@@ -29,6 +29,7 @@ namespace Stratis.Guru
public Startup(IConfiguration configuration) public Startup(IConfiguration configuration)
{ {
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US");
CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("en-US");
Configuration = configuration; Configuration = configuration;
} }
...@@ -98,17 +99,21 @@ namespace Stratis.Guru ...@@ -98,17 +99,21 @@ namespace Stratis.Guru
var supportedCultures = new[] var supportedCultures = new[]
{ {
new CultureInfo("en"), new CultureInfo("en-US"),
new CultureInfo("en-GB"),
new CultureInfo("fr-FR"), new CultureInfo("fr-FR"),
new CultureInfo("ru"), new CultureInfo("ru-RU"),
new CultureInfo("it"), new CultureInfo("it-IT"),
new CultureInfo("de"), new CultureInfo("de-DE"),
new CultureInfo("cn") new CultureInfo("cn-CN")
}; };
var defaultCulture = new RequestCulture("en-US");
defaultCulture.UICulture.NumberFormat.CurrencySymbol = "$";
app.UseRequestLocalization(new RequestLocalizationOptions app.UseRequestLocalization(new RequestLocalizationOptions
{ {
DefaultRequestCulture = new RequestCulture("en-US"), DefaultRequestCulture = defaultCulture,
SupportedCultures = supportedCultures, SupportedCultures = supportedCultures,
SupportedUICultures = supportedCultures SupportedUICultures = supportedCultures
}); });
......
@using System.Globalization @model Ticker
@model Ticker
@{ @{
ViewBag.Title = "Online Stratis ($STRAT) price ticker"; ViewBag.Title = "Online Stratis ($STRAT) price ticker";
} }
......
@using Stratis.Guru @using Stratis.Guru
@using Stratis.Guru.Models @using Stratis.Guru.Models
@using System.Globalization
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment