Review ChangeAvoidanceSuggestionControl
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/ChangeAvoidanceSuggestionViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/ChangeAvoidanceSuggestionViewModel.cs
@@ -18,7 +18,7 @@ public partial class ChangeAvoidanceSuggestionViewModel : SuggestionViewModel
{
private const int SignificantFiguresForFiatAmount = 3;
[AutoNotify] private string _amount;
- [AutoNotify] private string _amountFiat;
+ [AutoNotify] private decimal _amountFiat;
[AutoNotify] private string? _differenceFiat;
public ChangeAvoidanceSuggestionViewModel(
@@ -31,9 +31,10 @@ public partial class ChangeAvoidanceSuggestionViewModel : SuggestionViewModel
var totalAmount = transactionResult.CalculateDestinationAmount();
var total = totalAmount.ToDecimal(MoneyUnit.BTC);
- _amountFiat = total.RoundToSignificantFigures(SignificantFiguresForFiatAmount).GenerateFiatText(fiatExchangeRate, "USD");
-
var fiatTotal = total * fiatExchangeRate;
+
+ _amountFiat = fiatTotal;
+
var fiatOriginal = originalAmount * fiatExchangeRate;
var fiatDifference = fiatTotal - fiatOriginal;
var roundedFiatDifference = fiatDifference.RoundToSignificantFigures(SignificantFiguresForFiatAmount);

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/ChangeAvoidanceSuggestionControl.axaml
WalletWasabi.Fluent/Views/Wallets/Send/ChangeAvoidanceSuggestionControl.axaml
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:WalletWasabi.Fluent.ViewModels.Wallets.Send"
+ xmlns:converters="clr-namespace:WalletWasabi.Fluent.Converters"
mc:Ignorable="d" d:DesignWidth="300" d:DesignHeight="450"
x:DataType="vm:ChangeAvoidanceSuggestionViewModel"
ClipToBounds="False"
<TextBlock Text="{Binding DifferenceFiat}" FontSize="20" HorizontalAlignment="Center"
Foreground="{DynamicResource SystemAccentColor}" />
<TextBlock Text="{Binding Amount}" FontSize="12" HorizontalAlignment="Center" Opacity="0.6" />
- <TextBlock Text="{Binding AmountFiat}" FontSize="12" HorizontalAlignment="Center" Opacity="0.6" />
+ <TextBlock Text="{Binding AmountFiat, Converter={x:Static converters:MoneyConverters.ToUsd}}" FontSize="12" HorizontalAlignment="Center" Opacity="0.6" />
</StackPanel>
</StackPanel>
</Panel>

Review ChangeAvoidanceSuggestionControl