mirror of
https://github.com/koloideal/Casha.git
synced 2026-06-10 10:25:28 +03:00
10 lines
318 B
Dart
10 lines
318 B
Dart
String formatAmount(String symbol, double amount) {
|
|
// 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';
|
|
}
|