NumberFormatterSettings.Symbols Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Symbols(DecimalFormatSymbols) |
Specifies the symbols (decimal separator, grouping separator, percent sign, numerals, etc. |
Symbols(NumberingSystem) |
Specifies that the given numbering system should be used when fetching symbols. |
Symbols(DecimalFormatSymbols)
Specifies the symbols (decimal separator, grouping separator, percent sign, numerals, etc.
[Android.Runtime.Register("symbols", "(Landroid/icu/text/DecimalFormatSymbols;)Landroid/icu/number/NumberFormatterSettings;", "GetSymbols_Landroid_icu_text_DecimalFormatSymbols_Handler", ApiSince=30)]
public virtual Java.Lang.Object? Symbols (Android.Icu.Text.DecimalFormatSymbols? symbols);
[<Android.Runtime.Register("symbols", "(Landroid/icu/text/DecimalFormatSymbols;)Landroid/icu/number/NumberFormatterSettings;", "GetSymbols_Landroid_icu_text_DecimalFormatSymbols_Handler", ApiSince=30)>]
abstract member Symbols : Android.Icu.Text.DecimalFormatSymbols -> Java.Lang.Object
override this.Symbols : Android.Icu.Text.DecimalFormatSymbols -> Java.Lang.Object
Parameters
- symbols
- DecimalFormatSymbols
The DecimalFormatSymbols to use.
Returns
The fluent chain.
- Attributes
Remarks
Specifies the symbols (decimal separator, grouping separator, percent sign, numerals, etc.) to use when rendering numbers.
<ul> <li><em>en_US</em> symbols: "12,345.67" <li><em>fr_FR</em> symbols: "12 345,67" <li><em>de_CH</em> symbols: "12’345.67" <li><em>my_MY</em> symbols: "၁၂,၃၄၅.၆၇" </ul>
Pass this method an instance of DecimalFormatSymbols
. For example:
NumberFormatter.with().symbols(DecimalFormatSymbols.getInstance(new ULocale("de_CH")))
<strong>Note:</strong> DecimalFormatSymbols automatically chooses the best numbering system based on the locale. In the examples above, the first three are using the Latin numbering system, and the fourth is using the Myanmar numbering system.
<strong>Note:</strong> The instance of DecimalFormatSymbols will be copied: changes made to the symbols object after passing it into the fluent chain will not be seen.
<strong>Note:</strong> Calling this method will override the NumberingSystem previously specified in #symbols(NumberingSystem)
.
The default is to choose the symbols based on the locale specified in the fluent chain.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
Symbols(NumberingSystem)
Specifies that the given numbering system should be used when fetching symbols.
[Android.Runtime.Register("symbols", "(Landroid/icu/text/NumberingSystem;)Landroid/icu/number/NumberFormatterSettings;", "GetSymbols_Landroid_icu_text_NumberingSystem_Handler", ApiSince=30)]
public virtual Java.Lang.Object? Symbols (Android.Icu.Text.NumberingSystem? ns);
[<Android.Runtime.Register("symbols", "(Landroid/icu/text/NumberingSystem;)Landroid/icu/number/NumberFormatterSettings;", "GetSymbols_Landroid_icu_text_NumberingSystem_Handler", ApiSince=30)>]
abstract member Symbols : Android.Icu.Text.NumberingSystem -> Java.Lang.Object
override this.Symbols : Android.Icu.Text.NumberingSystem -> Java.Lang.Object
Parameters
The NumberingSystem to use.
Returns
The fluent chain.
- Attributes
Remarks
Specifies that the given numbering system should be used when fetching symbols.
<ul> <li>Latin numbering system: "12,345" <li>Myanmar numbering system: "၁၂,၃၄၅" <li>Math Sans Bold numbering system: "𝟭𝟮,𝟯𝟰𝟱" </ul>
Pass this method an instance of NumberingSystem
. For example, to force the locale to always use the Latin alphabet numbering system (ASCII digits):
NumberFormatter.with().symbols(NumberingSystem.LATIN)
<strong>Note:</strong> Calling this method will override the DecimalFormatSymbols previously specified in #symbols(DecimalFormatSymbols)
.
The default is to choose the best numbering system for the locale.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.