number library

Classes

FlexiFormatter

Enums

ExplicitDirection
https://unicode.org/reports/tr9 为何建议使用隔离字符?
RoundMode
ShrinkZeroMode
多零收缩模式

Constants

defaultDecimalSeparator → const String
默认小数点分隔符
defaultGroupIntegerCounts → const int
默认整数部分分组数量计数
defaultGroupIntegerSeparator → const String
默认整数部分分组(千分位)分隔符
defaultPrecentSign → const String
默认百分比符号
defaultScaleOnInfinitePrecision → const int
无限精度Decimal的除法精度
maxGroupIntegerCounts → const int
最大可分组计数
subscriptNegative → const String
subscriptNumerals → const List<String>
下角标的数字符号12345₀₁₂₃₄₅₆₇₈₉₊₋
subscriptPositive → const String
下角标的正负号
superscriptNegative → const String
superscriptNumerals → const List<String>
上角标的数字符号12345⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻
superscriptPositive → const String
上角标的正负号
uniFSI → const String
uniLRE → const String
显式定向嵌入和覆盖格式字符(Embeddings & Overrides)
uniLRI → const String
显式定向隔离格式字符(Isolates)
uniLRO → const String
uniPDF → const String
uniPDI → const String
uniRLE → const String
uniRLI → const String
uniRLO → const String

Properties

billion → Decimal
final
defaultExponentMaxDecimal → Decimal
final
defaultExponentMinDecimal → Decimal
final
fifty → Decimal
final
hundred → Decimal
final
hundredMillion → Decimal
final
million → Decimal
final
one → Decimal
final
tenBillion → Decimal
final
tenThousand → Decimal
final
thousand → Decimal
final
three → Decimal
final
trillion → Decimal
final
twentieth → Decimal
final
two → Decimal
final

Functions

formatAmount(Decimal? val, {int? precision, bool showSign = false, bool signFirst = false, RoundMode? roundMode, bool enableCompact = true, CompactConverter? compactConverter, bool cutInvalidZero = true, ShrinkZeroMode? shrinkZeroMode, ShrinkZeroConverter? shrinkZeroConverter, ExplicitDirection? direction, String prefix = '', String suffix = '', String? defIfZero, String defIfNull = '--'}) String
格式化数量
formatNumber(Decimal? val, {int? precision, bool showSign = false, bool signFirst = false, RoundMode? roundMode, bool cutInvalidZero = false, bool enableCompact = false, CompactConverter? compactConverter, bool enableGrouping = false, String? groupSepartor, int? groupCounts, ShrinkZeroMode? shrinkZeroMode, ShrinkZeroConverter? shrinkZeroConverter, ExplicitDirection? direction, String prefix = '', String suffix = '', String? defIfZero, String defIfNull = '--'}) String
formatPercentage(Decimal? val, {bool expandHundred = true, int? precision, bool showSign = false, bool signFirst = true, RoundMode roundMode = RoundMode.truncate, bool cutInvalidZero = false, bool enableGrouping = true, ExplicitDirection? direction, bool? percentSignFirst, String prefix = '', String suffix = '', String? defIfZero, String defIfNull = '--'}) String
百分比
formatPrice(Decimal? val, {int? precision, bool showSign = false, bool signFirst = false, RoundMode roundMode = RoundMode.truncate, bool cutInvalidZero = true, bool enableGrouping = true, ShrinkZeroMode? shrinkZeroMode, ShrinkZeroConverter? shrinkZeroConverter, ExplicitDirection? direction, String prefix = '', String suffix = '', String? defIfZero, String defIfNull = '--'}) String
格式化价钱
nonShrinkZeroConverter(dynamic zeroCounts) String
不进行零收缩转换器
simplifiedChineseCompactConverter(Decimal val) → (Decimal, String)
简体中文精简转换器 Simplified Chinese compact conversion
thousandCompactConverter(Decimal val) → (Decimal, String)
千分位精简转换器
traditionalChineseCompactConverter(Decimal val) → (Decimal, String)
繁体中文精简转换器 Traditional Chinese compact conversion

Typedefs

CompactConverter = (Decimal, String) Function(Decimal value)
ShrinkZeroConverter = String Function(int zeroCounts)