convertMoneytoStringComma function
format tiền VN với pattern dấu phẩy(,)
Implementation
String convertMoneytoStringComma(num value) {
String price = value.toInt().toString();
if (price.length > 2) {
price = price.replaceAll(RegExp(r'\D'), '');
price = price.replaceAll(RegExp(r'\B(?=(\d{3})+(?!\d))'), ',');
return price;
} else {
return price;
}
}