IntFormating extension

  • @Author: chuxiong
  • @Created at: 2023/3/2 4:05 下午
  • @Email:
  • @Company: 嘉联支付
  • description int 扩展 依赖:decimal(纯 Dart,金额格式化用)。
on

Properties

autoUnitFormat → String

Available on int?, provided by the IntFormating extension

单位自动转换(万 / 亿)。null 返回 '0'。
no setter
currencyFormat → String

Available on int?, provided by the IntFormating extension

金额格式化处理(输入单位为分,恒定输出两位小数,且去掉无意义的 末尾 0:1500 → "15" 而非 "15.00")。null 返回 "0.0"。
no setter
defaultValue → int

Available on int?, provided by the IntFormating extension

安全取值:null → 0,否则返回自身(safeValue 的语义化别名)。
no setter
percentFormat → String

Available on int?, provided by the IntFormating extension

百分比格式化方法。
no setter
safeDoubleValue → double

Available on int?, provided by the IntFormating extension

安全取 double 值:null → 0.0。
no setter
safeValue → int

Available on int?, provided by the IntFormating extension

安全取值:null → 0,否则返回自身。
no setter
thousandSeparatedFormat → String

Available on int?, provided by the IntFormating extension

支持千分位格式化 123456789.thousandSeparatedFormat → "123,456,789"
no setter

Methods

currencyFormatWithDef(bool autoMoneyUnit) → String

Available on int?, provided by the IntFormating extension

金额格式化处理(输入单位为分)。
currencyFormatWithSymbol(String symbol, {bool autoMoneyUnit = false}) → String

Available on int?, provided by the IntFormating extension

通用货币格式化方法(带符号,输入单位为分)。