fix rate calculation

This commit is contained in:
Serhii 2024-05-03 17:57:40 +03:00
parent 444eeccc58
commit 08487b8dc5
2 changed files with 2 additions and 2 deletions

View file

@ -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;

View file

@ -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) {