Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DecimalFormatter class

Formats and parses decimal numbers.

Syntax


public ref class DecimalFormatter sealed : INumberFormatterOptions,
    INumberFormatter,
    INumberFormatter2,
    INumberParser,
    ISignificantDigitsOption,
    INumberRounderOption,
    ISignedZeroOption

Members

The DecimalFormatter class has these types of members:

Constructors

The DecimalFormatter class has these constructors.

ConstructorDescription
DecimalFormatter() Creates a DecimalFormatter object and initializes it to default values.
DecimalFormatter(IIterable(String), String) Creates a DecimalFormatter object initialized by a language list and a geographic region.

 

Methods

The DecimalFormatter class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
Format(Double) Returns a string representation of a Double number.
Format(Int64) Returns a string representation of an Int64 number.
Format(UInt64) Returns a string representation of a UInt64 number.
FormatDouble Returns a string representation of a Double number.
FormatInt Returns a string representation of an Int64 number.
FormatUInt Returns a string representation of a UInt64 number.
ParseDouble Attempts to parse a string representation of a Double number.
ParseInt Attempts to parse a string representation of an integer.
ParseUInt Attempts to parse a string representation of an unsigned integer.

 

Properties

The DecimalFormatter class has these properties.

PropertyAccess typeDescription

FractionDigits

Read/write

Gets or sets the minimum number of digits to display for the fraction part of the number.

GeographicRegion

Read-only

Gets the region that is used when formatting and parsing decimal numbers.

IntegerDigits

Read/write

Gets or sets the minimum number of digits to display for the integer part of the number.

IsDecimalPointAlwaysDisplayed

Read/write

Gets or sets whether the decimal point of the number should always be displayed.

IsGrouped

Read/write

Gets or sets whether the integer part of the number should be grouped.

IsZeroSigned

Read/write

Gets or sets whether -0 is formatted as -0 or 0.

Languages

Read-only

Gets the priority list of language identifiers that is used when formatting and parsing decimal numbers.

NumberRounder

Read/write

Gets or sets the current rounding strategy to be used when formatting numbers.

NumeralSystem

Read/write

Gets or sets the numbering system that is used to format and parse decimal numbers.

ResolvedGeographicRegion

Read-only

Gets the geographic region that was most recently used to format or parse decimal values.

ResolvedLanguage

Read-only

Gets the language that was most recently used to format or parse decimal values.

SignificantDigits

Read/write

Gets or sets the current padding to significant digits when a decimal number is formatted.

 

Remarks

If your app passes language tags used in this class to any National Language Support functions, it must first convert the tags by calling ResolveLocaleName.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Globalization.NumberFormatting
Windows::Globalization::NumberFormatting [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 [Windows Store apps, desktop apps]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.Globalization.NumberFormatting
Windows::Globalization::NumberFormatting [C++]

Metadata

Windows.winmd

Attributes

[DualApiPartition()]
[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]

See also

ISignedZeroOption
Object
INumberFormatterOptions
INumberFormatter
INumberFormatter2
INumberParser
ISignificantDigitsOption
INumberRounderOption
Number formatting and parsing sample (Windows 10)

 

 

Show: