formatCurrency static method

String formatCurrency(
  1. num? value, {
  2. String symbol = '¥',
  3. int fractionDigits = 2,
})

格式化为货币(默认¥,可传入其他符号)

Implementation

static String formatCurrency(num? value, {String symbol = '¥', int fractionDigits = 2}) {
  if (value == null) return '';
  return '$symbol${formatWithComma(value, fractionDigits: fractionDigits)}';
}