DecimalFormatter 類別

定義

格式化和剖析十進位數。

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
繼承
Object Platform::Object IInspectable DecimalFormatter
屬性
實作

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

備註

如果您的應用程式將此類別中使用的語言標籤傳遞至任何 國家語言支援 函式,則必須先呼叫 ResolveLocaleName來轉換標記。

建構函式

DecimalFormatter()

建立 DecimalFormatter 物件,並將其初始化為預設值。

DecimalFormatter(IIterable<String>, String)

建立由語言清單和地理區域初始化的 DecimalFormatter 物件。

屬性

FractionDigits

取得或設定要針對數位分數部分顯示的最小位數。

GeographicRegion

取得格式化和剖析十進位數時所使用的區域。

IntegerDigits

取得或設定要針對數位整數部分顯示的最小位數。

IsDecimalPointAlwaysDisplayed

取得或設定是否應該一律顯示數位的小數點。

IsGrouped

取得或設定數位的整數部分是否應該分組。

IsZeroSigned

取得或設定 -0 的格式為 「-0」 或 「0」。

Languages

取得格式化和剖析十進位數時所使用的語言識別項優先順序清單。

NumberRounder

取得或設定格式化數位時要使用的目前四捨五入策略。

NumeralSystem

取得或設定用來格式化和剖析十進位數的編號系統。

ResolvedGeographicRegion

取得最近用來格式化或剖析十進位值的地理區域。

ResolvedLanguage

取得最近用來格式化或剖析十進位值的語言。

SignificantDigits

取得或設定當小數格式化時,目前填補為有效位數。

方法

Format(Double)

傳回 Double 數位的字串表示。

Format(Int64)

傳回 Int64 數位的字串表示。

Format(UInt64)

傳回 UInt64 數位的字串表示。

FormatDouble(Double)

傳回 Double 數位的字串表示。

FormatInt(Int64)

傳回 Int64 數位的字串表示。

FormatUInt(UInt64)

傳回 UInt64 數位的字串表示。

ParseDouble(String)

嘗試剖析 雙精度浮點 數的字串表示。

ParseInt(String)

嘗試剖析整數的字串表示。

ParseUInt(String)

嘗試剖析不帶正負號整數的字串表示。

適用於

另請參閱