another sell shares rounding bug
This commit is contained in:
parent
5c18820d96
commit
95b67c05e2
|
@ -178,9 +178,10 @@ export function SellAmountInput(props: {
|
||||||
]
|
]
|
||||||
|
|
||||||
const sellOutcome = yesShares ? 'YES' : noShares ? 'NO' : undefined
|
const sellOutcome = yesShares ? 'YES' : noShares ? 'NO' : undefined
|
||||||
const shares = yesShares || noShares
|
const shares = Math.round(yesShares) || Math.round(noShares)
|
||||||
|
|
||||||
|
const sharesSold = Math.min(amount ?? 0, shares)
|
||||||
|
|
||||||
const sharesSold = Math.min(amount ?? 0, yesShares || noShares)
|
|
||||||
const { saleValue } = calculateCpmmSale(
|
const { saleValue } = calculateCpmmSale(
|
||||||
contract,
|
contract,
|
||||||
sharesSold,
|
sharesSold,
|
||||||
|
|
|
@ -432,7 +432,13 @@ export function SellPanel(props: {
|
||||||
<SellAmountInput
|
<SellAmountInput
|
||||||
inputClassName="w-full"
|
inputClassName="w-full"
|
||||||
contract={contract}
|
contract={contract}
|
||||||
amount={amount ? Math.floor(amount) : undefined}
|
amount={
|
||||||
|
amount
|
||||||
|
? Math.round(amount) === 0
|
||||||
|
? 0
|
||||||
|
: Math.floor(amount)
|
||||||
|
: undefined
|
||||||
|
}
|
||||||
onChange={setAmount}
|
onChange={setAmount}
|
||||||
userBets={userBets}
|
userBets={userBets}
|
||||||
error={error}
|
error={error}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user