getPrice method

String getPrice()

Groups a whole number with commas, "0" when empty. "1500000" → "1,500,000"

Implementation

String getPrice() {
  final int nums = (this ?? "0").toInt();
  return nums > 0 ? intl.NumberFormat("#,##0").format(nums) : "0";
}