mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-18 08:45:05 +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>;
|
final results = data['results'] as Map<String, dynamic>;
|
||||||
|
|
||||||
if (results.isNotEmpty) {
|
if (results.isNotEmpty) {
|
||||||
return (results.values.first as double) / 100000;
|
return (results.values.first as double) / 100000000;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -49,7 +49,7 @@ Future<void> historicalRateUpdate(
|
||||||
|
|
||||||
description ??= TransactionDescription(id: tx.id);
|
description ??= TransactionDescription(id: tx.id);
|
||||||
Map<String, String> rates = description.historicalRates;
|
Map<String, String> rates = description.historicalRates;
|
||||||
rates[fiatName] = result.toStringAsFixed(4);
|
rates[fiatName] = (result * tx.amount).toString();
|
||||||
description.historicalRates = rates;
|
description.historicalRates = rates;
|
||||||
await transactionDescription.put(tx.id, description);
|
await transactionDescription.put(tx.id, description);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in a new issue