Skip to main content
DecimalFormatter class

Applies to Windows and Windows Phone

Formats and parses decimal numbers.

Syntax


var decimalFormatter = new Windows.Globalization.NumberFormatting.DecimalFormatter(iIterable(String));
var decimalFormatter = new Windows.Globalization.NumberFormatting.DecimalFormatter();

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

Public NotInheritable Class DecimalFormatter
    Implements INumberFormatterOptions, _
    INumberFormatter, _
    INumberFormatter2, _
    INumberParser, _
    ISignificantDigitsOption, _
    INumberRounderOption, _
    ISignedZeroOption

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

Attributes

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

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/writeGets or sets the minimum number of digits to display for the fraction part of the number.

GeographicRegion

Read-onlyGets the region that is used when formatting and parsing decimal numbers.

IntegerDigits

Read/writeGets or sets the minimum number of digits to display for the integer part of the number.

IsDecimalPointAlwaysDisplayed

Read/writeGets or sets whether the decimal point of the number should always be displayed.

IsGrouped

Read/writeGets or sets whether the integer part of the number should be grouped.

IsZeroSigned

Read/writeGets or sets whether -0 is formatted as -0 or 0.

Languages

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

NumberRounder

Read/writeGets or sets the current rounding strategy to be used when formatting numbers.

NumeralSystem

Read/writeGets or sets the numbering system that is used to format and parse decimal numbers.

ResolvedGeographicRegion

Read-onlyGets the geographic region that was most recently used to format or parse decimal values.

ResolvedLanguage

Read-onlyGets the language that was most recently used to format or parse decimal values.

SignificantDigits

Read/writeGets 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

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

See also

Object
INumberFormatterOptions
INumberFormatter
INumberFormatter2
INumberParser
ISignificantDigitsOption
INumberRounderOption