mirror of
https://github.com/koloideal/Casha.git
synced 2026-06-10 10:25:28 +03:00
10 lines
350 B
Dart
10 lines
350 B
Dart
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 = fmt.format(amount);
|
|
final sep = spaceAfter.contains(symbol) ? ' ' : '';
|
|
return '$symbol$sep$formatted';
|
|
}
|