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.

CurrencyFormatter class

Applies to Windows and Windows Phone

Formats and parses currencies.

Syntax


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

Attributes

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

Members

The CurrencyFormatter class has these types of members:

Constructors

The CurrencyFormatter class has these constructors.

ConstructorDescription
CurrencyFormatter(String) Creates a CurrencyFormatter object that is initialized with a currency identifier.
CurrencyFormatter(String, IIterable(String), String) Creates a CurrencyFormatter object initialized with a currency identifier, language list, and geographic region.

 

Methods

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

MethodDescription
ApplyRoundingForCurrency Prepares the CurrencyFormatter object to format currency values with a specified rounding algorithm.
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 Returns a string representation of a Double currency value.
FormatInt Returns a string representation of an Int64 currency value.
FormatUInt Returns a string representation of a UInt64 currency value.
ParseDouble Attempts to parse a string representation of a Double currency value.
ParseInt Attempts to parse a string representation of an integer currency value.
ParseUInt Attempts to parse a string representation of an unsigned integer currency value.

 

Properties

The CurrencyFormatter class has these properties.

PropertyAccess typeDescription

Currency

Read/writeGets the identifier for the currency to be used for formatting and parsing currency values.

FractionDigits

Read/writeGets or sets the minimum number of digits to display for the fraction part of the currency value.

GeographicRegion

Read-onlyGets the region that is used when formatting and parsing currency values.

IntegerDigits

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

IsDecimalPointAlwaysDisplayed

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

IsGrouped

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

IsZeroSigned

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

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

Mode

Read/writeGets or sets whether the currency is formatted with the currency symbol or currency code.

NumberRounder

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

NumeralSystem

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

ResolvedGeographicRegion

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

ResolvedLanguage

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

SignificantDigits

Read/writeGets or sets the current padding to significant digits when a currency amount 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

 

 

Show:
© 2014 Microsoft