Skip to content

Commit

Permalink
fix: limit prediction decimals (#2161)
Browse files Browse the repository at this point in the history
  • Loading branch information
hexyls authored Aug 9, 2021
1 parent 88dc014 commit 29d0ab1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/util/tools/fpmm/trading/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { WeiPerEther, Zero } from 'ethers/constants'
import { BigNumber, bigNumberify } from 'ethers/utils'

import { STANDARD_DECIMALS } from '../../../../common/constants'
import { bigNumberToNumber } from '../../formatting'
import { bigNumberToNumber, limitDecimalPlaces } from '../../formatting'
import { ceilDiv, divBN, mulBN } from '../../maths'

/**
Expand Down Expand Up @@ -145,7 +145,7 @@ export const calcPrediction = (probability: string, lowerBound: BigNumber, upper
const lowerBoundNumber = bigNumberToNumber(lowerBound, STANDARD_DECIMALS)
const upperBoundNumber = bigNumberToNumber(upperBound, STANDARD_DECIMALS)
const prediction = probabilityNumber * (upperBoundNumber - lowerBoundNumber) + lowerBoundNumber
return prediction
return limitDecimalPlaces(String(prediction), STANDARD_DECIMALS)
}

/**
Expand Down

0 comments on commit 29d0ab1

Please sign in to comment.