From 08487b8dc5944b801da37fb7487af1adf43d9457 Mon Sep 17 00:00:00 2001 From: Serhii Date: Fri, 3 May 2024 17:57:40 +0300 Subject: [PATCH] fix rate calculation --- lib/core/fiat_conversion_service.dart | 2 +- lib/reactions/fiat_historical_rate_update.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/core/fiat_conversion_service.dart b/lib/core/fiat_conversion_service.dart index 822cf4563..3725a16ff 100644 --- a/lib/core/fiat_conversion_service.dart +++ b/lib/core/fiat_conversion_service.dart @@ -85,7 +85,7 @@ Future _fetchHistoricalPrice(Map args) async { final results = data['results'] as Map; if (results.isNotEmpty) { - return (results.values.first as double) / 100000; + return (results.values.first as double) / 100000000; } else { return null; diff --git a/lib/reactions/fiat_historical_rate_update.dart b/lib/reactions/fiat_historical_rate_update.dart index 6e3d11cf2..9adecba4e 100644 --- a/lib/reactions/fiat_historical_rate_update.dart +++ b/lib/reactions/fiat_historical_rate_update.dart @@ -49,7 +49,7 @@ Future historicalRateUpdate( description ??= TransactionDescription(id: tx.id); Map 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) {