getShortAmount method
Implementation
String getShortAmount(int amount, {String? textMany, String? textExtra}) {
var result = "";
if (amount < 1000)
result = amount.toString();
else if (amount < 1000000) {
var currency = getCurrency(amount, withoutRp: true);
result = currency.substring(0, currency.indexOf(".")) + " K";
} else if (amount < 1000000000) {
var currency = getCurrency(amount, withoutRp: true);
result = currency.substring(0, currency.indexOf(".")) + " M";
}
if (result.isNotEmpty) {
if (textExtra != null) return result += " $textExtra";
return result;
}
return textMany ?? "many";
}