limit price display fix
This commit is contained in:
17
src/misc.js
17
src/misc.js
@@ -163,23 +163,6 @@ export function inversionPreference(chainId, base, quote) {
|
||||
return prefs.inverted[key] !== inputInverted
|
||||
}
|
||||
|
||||
|
||||
export function pairPrice(chainId, baseToken, quoteToken, price) {
|
||||
if (price === null || price === undefined)
|
||||
return null
|
||||
const decimals = quoteToken.d - baseToken.d
|
||||
// console.log('pairPrice', chainId, baseToken, quoteToken, price, decimals)
|
||||
if (decimals >= 0)
|
||||
price /= 10 ** decimals
|
||||
else
|
||||
price *= 10 ** -decimals
|
||||
// console.log('adjusted pairPrice', price)
|
||||
if (inversionPreference(chainId, baseToken, quoteToken))
|
||||
price = 1 / price
|
||||
// console.log('inverted?', price)
|
||||
return price
|
||||
}
|
||||
|
||||
export const sleep = ms => new Promise(r => setTimeout(r, ms))
|
||||
|
||||
export function uuid() {
|
||||
|
||||
Reference in New Issue
Block a user