Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #8232: Display 0 for send amount for all percentage if selected t…
Browse files Browse the repository at this point in the history
…oken balanc… (#8234)
  • Loading branch information
nuo-xu authored Oct 12, 2023
1 parent b4c8b74 commit 6e9f9f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/BraveWallet/Crypto/Stores/SendTokenStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/BraveWallet/Crypto/Stores/SwapTokenStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6e9f9f4

Please sign in to comment.