diff --git a/snippets/csharp/System.Globalization/NumberFormatInfo/CurrencyNegativePattern/currencynegativepattern1.cs b/snippets/csharp/System.Globalization/NumberFormatInfo/CurrencyNegativePattern/currencynegativepattern1.cs index 63b51b27b82..a4b6a0bba67 100644 --- a/snippets/csharp/System.Globalization/NumberFormatInfo/CurrencyNegativePattern/currencynegativepattern1.cs +++ b/snippets/csharp/System.Globalization/NumberFormatInfo/CurrencyNegativePattern/currencynegativepattern1.cs @@ -13,7 +13,7 @@ public static void Main() string[] patternStrings= { "($n)", "-$n", "$-n", "$n-", "(n$)", "-n$", "n-$", "n$-", "-n $", "-$ n", "n $-", "$ n-", "$ -n", "n- $", "($ n)", - "(n $)" }; + "(n $)", "$- n" }; for (int ctr = patternStrings.GetLowerBound(0); ctr <= patternStrings.GetUpperBound(0); ctr++) patterns.Add(ctr, patternStrings[ctr]); @@ -48,4 +48,9 @@ public int Compare(CultureInfo x, CultureInfo y) // de-LI: 2 ( $-n) CHF-16.34 // de-LU: 8 ( -n $) -16,34 € // dsb-DE: 8 ( -n $) -16,34 € +// luy-KE: 16 ( $- n) Ksh- 16.34 +// +// The result shown here happens only if using ICU. +// Apps that use NLS, for example, .NET Framework apps, might see different results. +// Globalization data can change, which would also change these results. // diff --git a/snippets/csharp/System.IdentityModel.Tokens/IssuerNameRegistry/Overview/scripts/microsoftajax.debug.js b/snippets/csharp/System.IdentityModel.Tokens/IssuerNameRegistry/Overview/scripts/microsoftajax.debug.js index a5f7942ef2b..548facdfcc1 100644 --- a/snippets/csharp/System.IdentityModel.Tokens/IssuerNameRegistry/Overview/scripts/microsoftajax.debug.js +++ b/snippets/csharp/System.IdentityModel.Tokens/IssuerNameRegistry/Overview/scripts/microsoftajax.debug.js @@ -2979,7 +2979,7 @@ Number.prototype._toFormattedString = function Number$_toFormattedString(format, var _percentNegativePattern = ["-n %", "-n%", "-%n"]; var _numberNegativePattern = ["(n)","-n","- n","n-","n -"]; var _currencyPositivePattern = ["$n","n$","$ n","n $"]; - var _currencyNegativePattern = ["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"]; + var _currencyNegativePattern = ["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)","$- n"]; function zeroPad(str, count, left) { for (var l=str.length; l < count; l++) { str = (left ? ('0' + str) : (str + '0')); diff --git a/snippets/visualbasic/VS_Snippets_CLR_System/system.globalization.numberformatinfo.currencynegativepattern/vb/Project.vbproj b/snippets/visualbasic/VS_Snippets_CLR_System/system.globalization.numberformatinfo.currencynegativepattern/vb/Project.vbproj new file mode 100644 index 00000000000..08d2c8a2c9e --- /dev/null +++ b/snippets/visualbasic/VS_Snippets_CLR_System/system.globalization.numberformatinfo.currencynegativepattern/vb/Project.vbproj @@ -0,0 +1,8 @@ + + + + Exe + net7.0 + + + \ No newline at end of file diff --git a/snippets/visualbasic/VS_Snippets_CLR_System/system.globalization.numberformatinfo.currencynegativepattern/vb/currencynegativepattern1.vb b/snippets/visualbasic/VS_Snippets_CLR_System/system.globalization.numberformatinfo.currencynegativepattern/vb/currencynegativepattern1.vb index 988e5ad70d2..66e31a342a2 100644 --- a/snippets/visualbasic/VS_Snippets_CLR_System/system.globalization.numberformatinfo.currencynegativepattern/vb/currencynegativepattern1.vb +++ b/snippets/visualbasic/VS_Snippets_CLR_System/system.globalization.numberformatinfo.currencynegativepattern/vb/currencynegativepattern1.vb @@ -13,7 +13,7 @@ Public Class Example : Implements IComparer(Of CultureInfo) Dim patternStrings() As String = { "($n)", "-$n", "$-n", "$n-", "(n$)", "-n$", "n-$", "n$-", "-n $", "-$ n", "n $-", "$ n-", "$ -n", "n- $", "($ n)", - "(n $)" } + "(n $)", "$- n" } For ctr As Integer = patternStrings.GetLowerBound(0) To patternStrings.GetUpperBound(0) patterns.Add(ctr, patternStrings(ctr)) Next @@ -49,4 +49,9 @@ End Class ' de-LI: 2 ( $-n) CHF-16.34 ' de-LU: 8 ( -n $) -16,34 € ' dsb-DE: 8 ( -n $) -16,34 € +' luy-KE: 16 ( $- n) Ksh- 16.34 +' +' The result shown here happens only if using ICU. +' Apps that use NLS, for example, .NET Framework apps, might see different results. +' Globalization data can change, which would also change these results. ' diff --git a/xml/System.Globalization/NumberFormatInfo.xml b/xml/System.Globalization/NumberFormatInfo.xml index 6a7dcc35caf..77b245a3aa1 100644 --- a/xml/System.Globalization/NumberFormatInfo.xml +++ b/xml/System.Globalization/NumberFormatInfo.xml @@ -851,6 +851,7 @@ |13|n- $| |14|($ n)| |15|(n $)| +|16|$- n| @@ -862,7 +863,7 @@ ]]> - The property is being set to a value that is less than 0 or greater than 15. + The property is set to a value that's less than 0 or greater than 16. On .NET Core 3.1 and earlier versions, this exception is thrown if the value is greater than 15. The property is being set and the object is read-only.