formatNumber method

String? formatNumber({
  1. int fixed = 3,
  2. NumberFormat? using,
})

Implementation

String? formatNumber({int fixed = 3, NumberFormat? using}) {
  if (this == null) return null;
  if (using != null) return using.format(this);
  return isIntegral ? "${this?.toInt()}" : this!.toStringAsFixed(fixed);
}