kliToYuanStr method

String kliToYuanStr({
  1. String? symbol,
  2. NumFormat format = NumFormat.def,
  3. bool isPrefix = true,
})

分转元之后格式化 symbol:货币符号 ,isPrefix:货币符号是否在前面(true = $1.0 ,false = 1.0$)

  1234.kliToYuanStr(symbol: '$', format: NumFormat.def, isPrefix: false) => 1.23$}

Implementation

String kliToYuanStr(
    {String? symbol,
    NumFormat format = NumFormat.def,
    bool isPrefix = true}) {
  var feeStr = kliToYuan().kformatStr(format: format);
  if (symbol == null || symbol.isEmpty) {
    return feeStr;
  } else {
    return isPrefix ? "$symbol$feeStr" : "$feeStr$symbol";
  }
}