Files
hash-wallet/lib/entities/calculate_fiat_amount_raw.dart
T
jwinterm 788318a3a2 style: format Dart at 100 columns, as upstream does
Upstream reformatted its whole tree in 16ddc0837. Matching it removes
formatting from the conflict surface of this and every later sync.
2026-10-24 22:48:17 -04:00

20 lines
384 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.isFinite) {
return '0.00';
}
if (result == 0.0) {
return '0.00';
}
return result > 0.01 ? formatWithCommas(result.toStringAsFixed(2)) : '< 0.01';
}