formatVND method

String formatVND(
  1. double price
)

Implementation

String formatVND(double price) {
  return price.toInt().toString().replaceAllMapped(
            RegExp(r'(\d)(?=(\d{3})+(?!\d))'),
            (m) => '${m[1]}.',
          ) +
      ' VNĐ';
}