CurrencyFormatter Class

Definition

Formats and parses currencies.

public ref class CurrencyFormatter sealed : INumberRounderOption, ISignedZeroOption, ISignificantDigitsOption
class CurrencyFormatter sealed : INumberRounderOption, ISignedZeroOption, ISignificantDigitsOption
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Globalization.NumberFormatting.ICurrencyFormatterFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.DualApiPartition(version=100794368)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class CurrencyFormatter : INumberRounderOption, ISignedZeroOption, ISignificantDigitsOption
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.DualApiPartition(version=100794368)]
[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.ICurrencyFormatterFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class CurrencyFormatter : INumberRounderOption, ISignedZeroOption, ISignificantDigitsOption
function CurrencyFormatter(currencyCode, languages, geographicRegion)
Public NotInheritable Class CurrencyFormatter
Implements INumberRounderOption, ISignedZeroOption, ISignificantDigitsOption
Inheritance
CurrencyFormatter
Attributes
Implements
<xref href="Windows.Globalization.NumberFormatting.INumberFormatter?alt=Windows.Globalization.NumberFormatting.INumberFormatter&text=INumberFormatter" data-throw-if-not-resolved="True"/> <xref href="Windows.Globalization.NumberFormatting.INumberFormatter2?alt=Windows.Globalization.NumberFormatting.INumberFormatter2&text=INumberFormatter2" data-throw-if-not-resolved="True"/> <xref href="Windows.Globalization.NumberFormatting.INumberFormatterOptions?alt=Windows.Globalization.NumberFormatting.INumberFormatterOptions&text=INumberFormatterOptions" data-throw-if-not-resolved="True"/> <xref href="Windows.Globalization.NumberFormatting.INumberParser?alt=Windows.Globalization.NumberFormatting.INumberParser&text=INumberParser" data-throw-if-not-resolved="True"/> <xref href="Windows.Globalization.NumberFormatting.INumberRounderOption?alt=Windows.Globalization.NumberFormatting.INumberRounderOption&text=INumberRounderOption" data-throw-if-not-resolved="True"/> <xref href="Windows.Globalization.NumberFormatting.ISignedZeroOption?alt=Windows.Globalization.NumberFormatting.ISignedZeroOption&text=ISignedZeroOption" data-throw-if-not-resolved="True"/> <xref href="Windows.Globalization.NumberFormatting.ISignificantDigitsOption?alt=Windows.Globalization.NumberFormatting.ISignificantDigitsOption&text=ISignificantDigitsOption" data-throw-if-not-resolved="True"/>

Windows 10 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

CurrencyFormatter(String)

Creates a CurrencyFormatter object that is initialized with a currency identifier.

CurrencyFormatter(String, IEnumerable<String>, String)

Creates a CurrencyFormatter object initialized with a currency identifier, language list, and geographic region.

Properties

Currency

Note

Currency may be read-only for releases after Windows 8.1. Instead, use a new CurrencyFormatter.

Gets the identifier for the currency to be used for formatting and parsing currency values.

FractionDigits

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

GeographicRegion

Gets the region that is used when formatting and parsing currency values.

IntegerDigits

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

IsDecimalPointAlwaysDisplayed

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

IsGrouped

Gets or sets whether the integer part of the currency value should be grouped. The default value is false.

IsZeroSigned

Gets or sets whether -0 is formatted using the conventions for negative numbers or for positive numbers. (In the Latin numeral system, the choice is "-0" or "0".)

Languages

Gets the priority list of language identifiers that is used when formatting and parsing currency values.

Mode

Gets or sets whether the currency is formatted with the currency symbol or currency code.

NumberRounder

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

NumeralSystem

Gets or sets the numbering system that is used to format and parse currency values.

ResolvedGeographicRegion

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

ResolvedLanguage

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

SignificantDigits

Gets or sets the current padding to significant digits when a currency amount is formatted.

Methods

ApplyRoundingForCurrency(RoundingAlgorithm)

Applies the specified rounding algorithm to the CurrencyFormatter.

Format(Double)

Returns a string representation of a Double currency value.

Format(Int64)

Returns a string representation of an Int64 currency value.

Format(UInt64)

Returns a string representation of a UInt64 currency value.

FormatDouble(Double)

Returns a string representation of a Double currency value.

FormatInt(Int64)

Returns a string representation of an Int64 currency value.

FormatUInt(UInt64)

Returns a string representation of a UInt64 currency value.

ParseDouble(String)

Attempts to parse a string representation of a Double currency value.

ParseInt(String)

Attempts to parse a string representation of an integer currency value.

ParseUInt(String)

Attempts to parse a string representation of an unsigned integer currency value.

Applies to

See also