mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-03 17:40:43 +00:00
fix rate calculation
This commit is contained in:
parent
444eeccc58
commit
08487b8dc5
2 changed files with 2 additions and 2 deletions
|
@ -85,7 +85,7 @@ Future<double?> _fetchHistoricalPrice(Map<String, dynamic> args) async {
|
|||
final results = data['results'] as Map<String, dynamic>;
|
||||
|
||||
if (results.isNotEmpty) {
|
||||
return (results.values.first as double) / 100000;
|
||||
return (results.values.first as double) / 100000000;
|
||||
|
||||
} else {
|
||||
return null;
|
||||
|
|
|
@ -49,7 +49,7 @@ Future<void> historicalRateUpdate(
|
|||
|
||||
description ??= TransactionDescription(id: tx.id);
|
||||
Map<String, String> rates = description.historicalRates;
|
||||
rates[fiatName] = result.toStringAsFixed(4);
|
||||
rates[fiatName] = (result * tx.amount).toString();
|
||||
description.historicalRates = rates;
|
||||
await transactionDescription.put(tx.id, description);
|
||||
} catch (e) {
|
||||
|
|
Loading…
Reference in a new issue