Skip to content

Commit

Permalink
Percentage Picker fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SecretSaturn committed Sep 27, 2024
1 parent 2ac5e0a commit 7358b69
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/pages/ibc/components/IbcForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export default function IbcForm() {
) {
const scaledAmount = (balance as BigNumber)
.times(percentage / 100)
.minus(1)
.dividedBy(`1e${formik.values.token.decimals}`)
.decimalPlaces(formik.values.token.decimals, BigNumber.ROUND_DOWN)

Expand Down
1 change: 1 addition & 0 deletions src/pages/send/components/SendForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export default function SendForm() {
) {
const scaledAmount = (balance as BigNumber)
.times(percentage / 100)
.minus(1)
.dividedBy(`1e${formik.values.token.decimals}`)
.decimalPlaces(formik.values.token.decimals, BigNumber.ROUND_DOWN)

Expand Down
1 change: 1 addition & 0 deletions src/pages/wrap/components/WrapForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export default function WrapForm() {
) {
const scaledAmount = (balance as BigNumber)
.times(percentage / 100)
.minus(1)
.dividedBy(`1e${formik.values.token.decimals}`)
.decimalPlaces(formik.values.token.decimals, BigNumber.ROUND_DOWN)

Expand Down

0 comments on commit 7358b69

Please sign in to comment.