show differences in fiat.
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacySuggestionControlViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacySuggestionControlViewModel.cs
using System;
-using System.Globalization;
-using System.Linq;
using NBitcoin;
using WalletWasabi.Blockchain.TransactionBuilding;
using WalletWasabi.Fluent.Helpers;
@@ -30,11 +28,17 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
decimal total = transactionResult.CalculateDestinationAmount().ToDecimal(MoneyUnit.BTC);
+ var fiatTotal = total * fiatExchangeRate;
+
+ _amountFiat = total.GenerateFiatText(fiatExchangeRate, "USD");
+
if (optimisationLevel == PrivacyOptimisationLevel.Better)
{
- var pcDifference = ((total - originalAmount) / originalAmount) * 100;
+ var fiatOriginal = originalAmount * fiatExchangeRate;
+ var fiatDifference = fiatTotal - fiatOriginal;
- _caption = pcDifference > 0 ? $"{pcDifference:F}% More" : $"{Math.Abs(pcDifference):F}% Less";
+ _caption = (fiatDifference > 0 ? $"{fiatDifference.GenerateFiatText("USD")} More" : $"{Math.Abs(fiatDifference).GenerateFiatText("USD")} Less")
+ .Replace("(", "").Replace(")", "");
}
else
{
@@ -42,8 +46,6 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
}
_amount = $"{total}";
-
- _amountFiat = total.GenerateFiatText(fiatExchangeRate, "USD");
}
public BuildTransactionResult TransactionResult => _transactionResult;

show differences in fiat.