number
library
Properties
billion
→ Decimal
Decimal constant: 1,000,000,000
Decimal常量: 1,000,000,000
final
defaultExponentMaxDecimal
→ Decimal
Default maximum exponent decimal: 10^21
默认最大指数Decimal: 10^21
final
defaultExponentMinDecimal
→ Decimal
Default minimum exponent decimal: 10^-15
默认最小指数Decimal: 10^-15
final
fifty
→ Decimal
Decimal constant: 50
Decimal常量: 50
final
hundred
→ Decimal
Decimal constant: 100
Decimal常量: 100
final
hundredMillion
→ Decimal
Decimal constant: 100,000,000
Decimal常量: 100,000,000
final
million
→ Decimal
Decimal constant: 1,000,000
Decimal常量: 1,000,000
final
one
→ Decimal
Decimal constant: 1
Decimal常量: 1
final
tenBillion
→ Decimal
Decimal constant: 10,000,000,000
Decimal常量: 10,000,000,000
final
tenThousand
→ Decimal
Decimal constant: 10,000
Decimal常量: 10,000
final
thousand
→ Decimal
Decimal constant: 1,000
Decimal常量: 1,000
final
three
→ Decimal
Decimal constant: 3
Decimal常量: 3
final
trillion
→ Decimal
Decimal constant: 1,000,000,000,000
Decimal常量: 1,000,000,000,000
final
twentieth
→ Decimal
Decimal constant: 1/20
Decimal常量: 1/20
final
two
→ Decimal
Decimal constant: 2
Decimal常量: 2
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
Format amount value
格式化数量值
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 ? groupSeparator , int ? groupCounts , ShrinkZeroMode ? shrinkZeroMode , ShrinkZeroConverter ? shrinkZeroConverter , ExplicitDirection ? direction , String prefix = '' , String suffix = '' , String ? defIfZero , String defIfNull = '--' })
→ String
Format number with various options
格式化数字, 支持多种选项
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
Format percentage value
格式化百分比值
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
Format price value
格式化价格值
nonShrinkZeroConverter (int zeroCounts )
→ String
Non-shrink zero converter
不进行零收缩转换器
simplifiedChineseCompactConverter (Decimal val )
→ (Decimal , String )
Simplified Chinese compact converter
简体中文精简转换器
thousandCompactConverter (Decimal val )
→ (Decimal , String )
Thousand compact converter
千分位精简转换器
traditionalChineseCompactConverter (Decimal val )
→ (Decimal , String )
Traditional Chinese compact converter
繁体中文精简转换器
Typedefs
CompactConverter
= (Decimal , String ) Function(Decimal value )
Compact converter function type, returns (converted value, unit)
精简转换器函数类型, 返回(转换后的值, 单位)
ShrinkZeroConverter
= String Function(int zeroCounts )
Shrink zero converter function type, converts zero count to string
零收缩转换器函数类型, 将零的数量转换为字符串