cake_wallet/lib/entities/calculate_fiat_amount_raw.dart
2020-09-21 14:50:26 +03:00

13 lines
No EOL
267 B
Dart

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