mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-22 06:28:39 +02:00
13 lines
277 B
Dart
13 lines
277 B
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 ? result.toStringAsFixed(2) : '< 0.01';
|
|
} |