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 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(
|
||||
contract,
|
||||
sharesSold,
|
||||
|
|
|
@ -432,7 +432,13 @@ export function SellPanel(props: {
|
|||
<SellAmountInput
|
||||
inputClassName="w-full"
|
||||
contract={contract}
|
||||
amount={amount ? Math.floor(amount) : undefined}
|
||||
amount={
|
||||
amount
|
||||
? Math.round(amount) === 0
|
||||
? 0
|
||||
: Math.floor(amount)
|
||||
: undefined
|
||||
}
|
||||
onChange={setAmount}
|
||||
userBets={userBets}
|
||||
error={error}
|
||||
|
|
Loading…
Reference in New Issue
Block a user