Posted 6 November 2019, 2:27 am EST
We have a multi culture app that needs to use various decimal places for quite a few languages.
Decimal => 50000.654
en-US N2 => 50,000.65
hu-HU N4 => 50 000,6540
How do you use N3 as an outputformat string?
OutputFormat = “{0:N2}” for value of 5000.654m has a printed results of {50001:N2}
// change culture
CultureInfo hungaryCulture = new CultureInfo("hu-HU");
hungaryCulture.NumberFormat.NumberNegativePattern = 4;
Thread.CurrentThread.CurrentCulture = hungaryCulture;
this.Gross.OutputFormat = "{0:N2}";
I also tried to use an outputFormat = “# ##0,00” but it didn’t recognize the format though it did not have any errors.
Thanks