This commit is contained in:
2026-03-20 16:40:25 +03:00
parent 250bd94812
commit 1daeb1aa22
7 changed files with 195 additions and 33 deletions
+6 -6
View File
@@ -1,9 +1,9 @@
String formatAmount(String symbol, double amount) {
import '../../core/constants.dart';
String formatAmount(String symbol, double amount, AmountFormat fmt) {
// Symbols that need a space after them (prefix symbols like Br, ₽ etc.)
const spaceAfter = {'Br', ''};
final formatted = amount.toStringAsFixed(2);
if (spaceAfter.contains(symbol)) {
return '$symbol $formatted';
}
return '$symbol$formatted';
final formatted = fmt.format(amount);
final sep = spaceAfter.contains(symbol) ? ' ' : '';
return '$symbol$sep$formatted';
}