Share via


DecimalFormatter Class

Definition

Formats and parses decimal numbers.

public ref class DecimalFormatter sealed : INumberFormatter, INumberFormatter2, INumberFormatterOptions, INumberParser, INumberRounderOption, ISignedZeroOption, ISignificantDigitsOption
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Activatable(Windows.Globalization.NumberFormatting.IDecimalFormatterFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class DecimalFormatter final : INumberFormatter, INumberFormatter2, INumberFormatterOptions, INumberParser, INumberRounderOption, ISignedZeroOption, ISignificantDigitsOption
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(Windows.Globalization.NumberFormatting.IDecimalFormatterFactory, 65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class DecimalFormatter final : INumberFormatter, INumberFormatter2, INumberFormatterOptions, INumberParser, INumberRounderOption, ISignedZeroOption, ISignificantDigitsOption
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Globalization.NumberFormatting.IDecimalFormatterFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class DecimalFormatter : INumberFormatter, INumberFormatter2, INumberFormatterOptions, INumberParser, INumberRounderOption, ISignedZeroOption, ISignificantDigitsOption
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Globalization.NumberFormatting.IDecimalFormatterFactory), 65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class DecimalFormatter : INumberFormatter, INumberFormatter2, INumberFormatterOptions, INumberParser, INumberRounderOption, ISignedZeroOption, ISignificantDigitsOption
function DecimalFormatter(languages, geographicRegion)
Public NotInheritable Class DecimalFormatter
Implements INumberFormatter, INumberFormatter2, INumberFormatterOptions, INumberParser, INumberRounderOption, ISignedZeroOption, ISignificantDigitsOption
Inheritance
Object Platform::Object IInspectable DecimalFormatter
Attributes
Implements

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

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.

Constructors

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.

Properties

FractionDigits

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

GeographicRegion

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

IntegerDigits

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

IsDecimalPointAlwaysDisplayed

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

IsGrouped

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

IsZeroSigned

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

Languages

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

NumberRounder

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

NumeralSystem

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

ResolvedGeographicRegion

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

ResolvedLanguage

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

SignificantDigits

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

Methods

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(Double)

Returns a string representation of a Double number.

FormatInt(Int64)

Returns a string representation of an Int64 number.

FormatUInt(UInt64)

Returns a string representation of a UInt64 number.

ParseDouble(String)

Attempts to parse a string representation of a Double number.

ParseInt(String)

Attempts to parse a string representation of an integer.

ParseUInt(String)

Attempts to parse a string representation of an unsigned integer.

Applies to

See also