# How to display token price quote when charting?

**URL:** <https://community.bitquery.io/t/how-to-display-token-price-quote-when-charting/420>\
**Category:** GraphQL API\
**Tags:** closed\
**Created:** [August 18, 2021, 3:36am UTC](https://community.bitquery.io/t/how-to-display-token-price-quote-when-charting/420 "2021-08-18T03:36:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stcroix](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@stcroix](https://community.bitquery.io/u/stcroix)\
**Post date:** [August 18, 2021, 3:36am UTC](https://community.bitquery.io/t/how-to-display-token-price-quote-when-charting/420/1 "2021-08-18T03:36:10Z")

</div>

Hi there,

Let’s say I’ve run the following query to get a quote (in WBNB) for a token;

```auto
{
  ethereum(network: bsc) {
    dexTrades(
      options: {desc: ["block.height", "tradeIndex"], limit: 1}
      exchangeName: {in: ["Pancake v2"]}
      baseCurrency: {is: "0x2eba09fb8063aedba27424de9bf0dcb41567a943"}
      quoteCurrency: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}
      height: {is: 9942312}
    ) {
      transaction {
        hash
      }
      tradeIndex
      smartContract {
        address {
          address
        }
        contractType
        currency {
          name
        }
      }
      tradeIndex
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
          unixtime
        }
        height
      }
      baseCurrency {
        symbol
        address
      }
      quoteCurrency {
        symbol
        address
      }
      quotePrice
    }
  }
}

```

The quote result is `"quotePrice": 4.726269578406308e-16`

How would I go about formatting this response to display properly when charting?

eg.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/6355eed7c7e75801d96c8f60d84b98163e29eb6f.png)

Bonus question: How can I convert that result into a BigNumber to work with in web3 or ethers given it would throw an underflow error?

Many thanks

---

<div class="post-metadata">

**Author:** ![sayon](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sayon](https://community.bitquery.io/u/sayon)\
**Post date:** [August 18, 2021, 6:37am UTC](https://community.bitquery.io/t/how-to-display-token-price-quote-when-charting/420/2 "2021-08-18T06:37:02Z")

</div>

Were you following this tutorial?

> [@Integrating Tradingview’s Technical Analysis Charts with Bitquery GraphQL API using VueJS](https://community.bitquery.io/t/integrating-tradingview-s-technical-analysis-charts-with-bitquery-graphql-api-using-vuejs/343):
>
> This article focuses on integrating Tradingview’s Technical Analysis charts with Bitquery’s GraphQL API in a VueJS web application and using the Moving Average Exponential indicator within the integrated chart to get vital insights of the data. In this article, we will be integrating the Technical Analysis Charts with VueJS and adding an Moving Average Exponential indicator later. Technical Analysis Charts is a powerful, scalable and informative charting library provided by Tradingview only to …

If yes, then in the **./components/api/index.js** file, you must have seen that a query like this is used to find the baseCurrency value which is injected into the **symbol** object and later, in the **getBars** method (which is responsible for the loading of the chart).

---

<div class="post-metadata">

**Author:** ![stcroix](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@stcroix](https://community.bitquery.io/u/stcroix)\
**Post date:** [August 19, 2021, 11:16am UTC](https://community.bitquery.io/t/how-to-display-token-price-quote-when-charting/420/3 "2021-08-19T11:16:57Z")

</div>

Thanks @sayon, I may have jumped the gun a bit as i didn’t understand how the charts were formatting the numbers. I’m not using Tradingview just yet so was curious how to format the amount using vanilla JS. I was able to write a function that parses the amount from Bitquery and returns it in the same format as the charts. Thanks again
