Files
hash-wallet/lib/entities/calculate_fiat_amount_raw.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

15 lines
333 B
Dart

import 'calculate_fiat_amount.dart';
String calculateFiatAmountRaw({required double cryptoAmount, double? price}) {
if (price == null) {
return '0.00';
}
final result = price * cryptoAmount;
if (result == 0.0) {
return '0.00';
}
return result > 0.01 ? formatWithCommas(result.toStringAsFixed(2)) : '< 0.01';
}