CurrencyFormatter 类

定义

格式化和分析货币。

public ref class CurrencyFormatter sealed : INumberRounderOption, ISignedZeroOption, ISignificantDigitsOption
/// [Windows.Foundation.Metadata.Activatable(Windows.Globalization.NumberFormatting.ICurrencyFormatterFactory, 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 CurrencyFormatter final : 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.ICurrencyFormatterFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class CurrencyFormatter final : 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.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.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
继承
Object Platform::Object IInspectable CurrencyFormatter
属性
实现

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

注解

如果你的应用将此类中使用的语言标记传递给任何 国家语言支持 函数,它必须首先通过调用 ResolveLocaleName 来转换标记。

构造函数

CurrencyFormatter(String)

创建使用货币标识符初始化的 CurrencyFormatter 对象。

CurrencyFormatter(String, IIterable<String>, String)

创建使用货币标识符、语言列表和地理区域初始化的 CurrencyFormatter 对象。

属性

Currency

注意

Windows 8.1后版本的货币可能为只读。 请改用新的 CurrencyFormatter

获取要用于格式化和分析货币值的货币的标识符。

FractionDigits

获取或设置要为货币值的分数部分显示的最小位数。

GeographicRegion

获取格式化和分析货币值时使用的区域。

IntegerDigits

获取或设置要为货币值的整数部分显示的最小位数。

IsDecimalPointAlwaysDisplayed

获取或设置是否应始终显示货币值的小数点。

IsGrouped

获取或设置是否应对货币值的整数部分进行分组。 默认值是 false

IsZeroSigned

获取或设置使用负数约定还是正数约定设置 -0 的格式。 (在拉丁语数字系统中,选择为“-0”或“0”。)

Languages

获取格式化和分析货币值时使用的语言标识符的优先级列表。

Mode

获取或设置是否使用货币符号或货币代码设置货币格式。

NumberRounder

获取或设置货币金额格式时要使用的当前舍入策略。

NumeralSystem

获取或设置用于格式化和分析货币值的编号系统。

ResolvedGeographicRegion

获取最近用于格式化或分析货币值的地理区域。

ResolvedLanguage

获取最近用于设置货币值格式或分析货币值的语言。

SignificantDigits

获取或设置货币金额格式时当前填充为有效数字。

方法

ApplyRoundingForCurrency(RoundingAlgorithm)

将指定的舍入算法应用于 CurrencyFormatter

Format(Double)

返回 精度货币值的字符串表示形式。

Format(Int64)

返回 Int64 货币值的字符串表示形式。

Format(UInt64)

返回 UInt64 货币值的字符串表示形式。

FormatDouble(Double)

返回 精度货币值的字符串表示形式。

FormatInt(Int64)

返回 Int64 货币值的字符串表示形式。

FormatUInt(UInt64)

返回 UInt64 货币值的字符串表示形式。

ParseDouble(String)

尝试分析 精度货币值的字符串表示形式。

ParseInt(String)

尝试分析整数货币值的字符串表示形式。

ParseUInt(String)

尝试分析无符号整数货币值的字符串表示形式。

适用于

另请参阅