Final review
MODIFY
WalletWasabi.Fluent/Converters/MoneyConverters.cs
WalletWasabi.Fluent/Converters/MoneyConverters.cs
using Avalonia.Data.Converters;
-using NBitcoin;
-using WalletWasabi.Fluent.Helpers;
-using WalletWasabi.Helpers;
+using WalletWasabi.Fluent.Extensions;
namespace WalletWasabi.Fluent.Converters;
public static class MoneyConverters
{
- public static readonly IValueConverter ToFormattedString =
- new FuncValueConverter<Money?, string>(money => money is null ? "" : money.ToFormattedString());
-
public static readonly IValueConverter ToUsd =
- new FuncValueConverter<decimal, string>(n => n.RoundToSignificantFigures(5) + " USD");
+ new FuncValueConverter<decimal, string>(n => n.ToUsd());
+
+ public static readonly IValueConverter ToUsdAproxBetweenParens =
+ new FuncValueConverter<decimal, string>(n => n.ToUsdAproxBetweenParens());
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/BtcPriceTileViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/BtcPriceTileViewModel.cs
@@ -11,13 +11,13 @@ public class BtcPriceTileViewModel : TileViewModel
{
Wallet = wallet;
- BtcPrice = this
+ UsdPerBtc = this
.WhenAnyValue(x => x.Wallet.Synchronizer.UsdExchangeRate)
.ObserveOn(RxApp.MainThreadScheduler)
.ReplayLastActive();
}
- public IObservable<decimal> BtcPrice { get; }
+ public IObservable<decimal> UsdPerBtc { get; }
private Wallet Wallet { get; }
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/ChangeAvoidanceSuggestionViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/ChangeAvoidanceSuggestionViewModel.cs
@@ -7,6 +7,7 @@ using System.Threading;
using System.Threading.Tasks;
using WalletWasabi.Blockchain.TransactionBuilding;
using WalletWasabi.Blockchain.TransactionOutputs;
+using WalletWasabi.Fluent.Extensions;
using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Helpers;
using WalletWasabi.Logging;
@@ -37,11 +38,10 @@ public partial class ChangeAvoidanceSuggestionViewModel : SuggestionViewModel
var fiatOriginal = originalAmount * fiatExchangeRate;
var fiatDifference = fiatTotal - fiatOriginal;
- var roundedFiatDifference = fiatDifference.RoundToSignificantFigures(SignificantFiguresForFiatAmount);
_differenceFiat = (fiatDifference > 0
- ? $"{roundedFiatDifference.GenerateFiatText("USD")} More"
- : $"{Math.Abs(roundedFiatDifference).GenerateFiatText("USD")} Less")
+ ? $"{fiatDifference.ToUsd()} More"
+ : $"{Math.Abs(fiatDifference).ToUsd()} Less")
.Replace("(", "").Replace(")", "");
_amount = $"{totalAmount.ToFormattedString()} BTC";

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionSummaryViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionSummaryViewModel.cs
@@ -57,12 +57,12 @@ public partial class TransactionSummaryViewModel : ViewModelBase
var destinationAmount = _transaction.CalculateDestinationAmount();
var btcAmountText = $"{destinationAmount.ToFormattedString()} BTC";
var exchangeRate = _wallet.Synchronizer.UsdExchangeRate;
- var fiatAmountText = destinationAmount.BtcToUsd(exchangeRate).ToUsdAprox();
+ var fiatAmountText = destinationAmount.BtcToUsd(exchangeRate).ToUsdAproxBetweenParens();
AmountText = $"{btcAmountText} {fiatAmountText}";
var fee = _transaction.Fee;
var feeText = fee.ToFeeDisplayUnitString();
- var fiatFeeText = fee.BtcToUsd(exchangeRate).ToUsdAprox();
+ var fiatFeeText = fee.BtcToUsd(exchangeRate).ToUsdAproxBetweenParens();
FeeText = $"{feeText} {fiatFeeText}";
TransactionHasChange =

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/BtcPriceTileView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/BtcPriceTileView.axaml
Classes="h2 monoSpaced"
VerticalAlignment="Center" HorizontalAlignment="Center"
TextAlignment="Center"
- Text="{Binding BtcPrice^, Converter={x:Static converters:MoneyConverters.ToUsd}}" />
+ Text="{Binding UsdPerBtc^, Converter={x:Static converters:MoneyConverters.ToUsd}}" />
</DockPanel>
</controls:TileControl>

Final review