mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-01 09:57:46 +00:00
13 lines
267 B
Dart
13 lines
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';
|
||
|
}
|