Skip to content

Commit

Permalink
fix rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
brenzi committed Apr 16, 2024
1 parent af784aa commit fa73fe3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/XcmTransfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@ const XcmTransfer = () => {
if (from === "Polkadot" || from === "Kusama") {
return Builder(api)
.to(to as TNode)
.amount(Number(amount) * Math.pow(10,12))
.amount(Math.floor(Number(amount) * Math.pow(10,12)))
.address(address)
.build();
} else if (to === "Polkadot" || to === "Kusama") {
return Builder(api)
.from(from as TNode)
.amount(Number(amount) * Math.pow(10,12))
.amount(Math.floor(Number(amount) * Math.pow(10,12)))
.address(address)
.build();
} else {
return Builder(api)
.from(from)
.to(to)
.currency(currency)
.amount(Number(amount) * Math.pow(10,12))
.amount(Math.floor(Number(amount) * Math.pow(10,12)))
.address(address)
.build();
}
Expand Down

0 comments on commit fa73fe3

Please sign in to comment.