priceFormat static method
Implementation
static String priceFormat(
{required double? price, String? priceUnit, bool isContact = false}) {
if (price != null && price != 0) {
final currencyFormatter = NumberFormat('#,###', 'VI');
if (priceUnit != null) {
return currencyFormatter.format(price) + " " + priceUnit;
} else {
return currencyFormatter.format(price) + "đ";
}
} else {
if (priceUnit != null) {
return "0" + priceUnit;
} else {
if (isContact) {
return "text_contact";
} else {
return "0đ";
}
}
}
}