route price lookup fixes

This commit is contained in:
Tim Olson
2023-11-18 15:57:50 -04:00
parent d1e304a562
commit 7293c101f8
5 changed files with 20 additions and 11 deletions

View File

@@ -21,11 +21,10 @@ const price = computed(()=>{
if( !route || !(route.pool in s.poolPrices) )
return ''
let p = s.poolPrices[route.pool]
console.log('pool price is',typeof p, p)
if( !p )
return ''
p = Number(p) // TODO: Temporary workaround. Better to fix reason for p being set to string.
console.log('pool price is',typeof p, p)
p = FixedNumber.fromString(p)
p = FixedNumber.fromString(p).toUnsafeFloat()
if( props.inverted )
p = 1/p
return p.toPrecision(props.precision)