Hi
In my project I`ve set my localization options as follows:
var dtf = new DateTimeFormatInfo { ShortDatePattern = "dd.MM.yyyy", LongDatePattern = "dd.MM.yyyy HH:mm", ShortTimePattern = "HH:mm", LongTimePattern = "HH:mm" }; var nf = new NumberFormatInfo { CurrencyDecimalSeparator = ",", CurrencyGroupSeparator = ".", NumberDecimalSeparator = ",", NumberGroupSeparator = ".", NumberDecimalDigits = 2 }; var supportedCultures = new[] { new CultureInfo("en-US") { DateTimeFormat = dtf, NumberFormat = nf }, new CultureInfo("en-GB") { DateTimeFormat = dtf, NumberFormat = nf }, new CultureInfo("en") { DateTimeFormat = dtf, NumberFormat = nf }, new CultureInfo("pl-PL") { DateTimeFormat = dtf, NumberFormat = nf }, new CultureInfo("pl") { DateTimeFormat = dtf, NumberFormat = nf } }; app.UseRequestLocalization(new RequestLocalizationOptions { DefaultRequestCulture = new RequestCulture("en-US"), SupportedCultures = supportedCultures, SupportedUICultures = supportedCultures });
However when I try to get some data through my API controller (with Accept-Language set to pl-PL) I get the following JSON result (only one decimal digit and dot instead of coma as a decimal separator):
"netValue": 120,"grossValueAdded": 147.6,
How to force my app to present JSON data in the correct format like this?
"netValue": 120,00,"grossValueAdded": 147,60,