Files
hash-wallet/lib/entities/format_amount.dart
T
David AdegokeandGitHub a41c23952f CW-1155: Mask fiat amounts to be more readable (#2420)
* feat: Mask fiat amounts to be more readable, with comma formating for large numbers

* fix: Add fiat masking to buy and sell
2025-07-31 19:46:13 +03:00

10 lines
325 B
Dart

import 'calculate_fiat_amount.dart';
String formatAmount(String amount) {
if ((!amount.contains('.'))&&(!amount.contains(','))) {
return formatWithCommas(amount + '.00');
} else if ((amount.endsWith('.'))||(amount.endsWith(','))) {
return formatWithCommas(amount + '00');
}
return formatWithCommas(amount);
}