From 6e9f9f40c5735fbbb422aeba31d66605b2922ff9 Mon Sep 17 00:00:00 2001 From: Nuo Xu Date: Thu, 12 Oct 2023 13:40:04 -0700 Subject: [PATCH] =?UTF-8?q?Fix=20#8232:=20Display=200=20for=20send=20amoun?= =?UTF-8?q?t=20for=20all=20percentage=20if=20selected=20token=20balanc?= =?UTF-8?q?=E2=80=A6=20(#8234)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/BraveWallet/Crypto/Stores/SendTokenStore.swift | 2 +- Sources/BraveWallet/Crypto/Stores/SwapTokenStore.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/BraveWallet/Crypto/Stores/SendTokenStore.swift b/Sources/BraveWallet/Crypto/Stores/SendTokenStore.swift index 2d496152d5d..3ddb3d33123 100644 --- a/Sources/BraveWallet/Crypto/Stores/SendTokenStore.swift +++ b/Sources/BraveWallet/Crypto/Stores/SendTokenStore.swift @@ -232,7 +232,7 @@ public class SendTokenStore: ObservableObject, WalletObserverStore { decimalPoint = Int(selectedSendToken?.decimals ?? 18) rounded = false } - sendAmount = ((selectedSendTokenBalance ?? 0) * amount.rawValue).decimalExpansion(precisionAfterDecimalPoint: decimalPoint, rounded: rounded) + sendAmount = ((selectedSendTokenBalance ?? 0) * amount.rawValue).decimalExpansion(precisionAfterDecimalPoint: decimalPoint, rounded: rounded).trimmingTrailingZeros } func didSelect(account: BraveWallet.AccountInfo, token: BraveWallet.BlockchainToken) { diff --git a/Sources/BraveWallet/Crypto/Stores/SwapTokenStore.swift b/Sources/BraveWallet/Crypto/Stores/SwapTokenStore.swift index dbaac4b1089..d2b2716bbde 100644 --- a/Sources/BraveWallet/Crypto/Stores/SwapTokenStore.swift +++ b/Sources/BraveWallet/Crypto/Stores/SwapTokenStore.swift @@ -915,7 +915,7 @@ public class SwapTokenStore: ObservableObject, WalletObserverStore { rounded = false } sellAmount = ((selectedFromTokenBalance ?? 0) * amount.rawValue) - .decimalExpansion(precisionAfterDecimalPoint: decimalPoint, rounded: rounded) + .decimalExpansion(precisionAfterDecimalPoint: decimalPoint, rounded: rounded).trimmingTrailingZeros } #if DEBUG