# Format number as money in Canvas

**URL:** <https://discuss.elastic.co/t/format-number-as-money-in-canvas/187198>\
**Category:** Kibana\
**Tags:** canvas\
**Created:** [June 24, 2019, 9:56pm UTC](https://discuss.elastic.co/t/format-number-as-money-in-canvas/187198 "2019-06-24T21:56:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Inammathe\_Inna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inammathe_inna/32/40656_2.png) [@Inammathe\_Inna](https://discuss.elastic.co/u/Inammathe_Inna)\
**Post date:** [June 24, 2019, 9:56pm UTC](https://discuss.elastic.co/t/format-number-as-money-in-canvas/187198/1 "2019-06-24T21:56:08Z")

</div>

Hey guys,

I realize there is already a couple of open issues related to this:

- [29190](https://github.com/elastic/kibana/issues/29190)
- [23111](https://github.com/elastic/kibana/issues/23111)

However, I was wondering if anyone knows another way to format a number to display as a currency (formatted with commas).

e.g. 1000000 becomes 1,000,000

In my case I am using essql:

```
SELECT ROUND(dollar_amount, 2)
FROM "index"

```

is there a way to achieve this without the use of the 'money' datatype (I don't think this type is supported in essql yet) or without a number formatting option?

Thanks!

---

<div class="post-metadata">

**Author:** ![LizaD](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lizad/32/51074_2.png) [@LizaD](https://discuss.elastic.co/u/LizaD)\
**Post date:** [June 24, 2019, 9:56pm UTC](https://discuss.elastic.co/t/format-number-as-money-in-canvas/187198/2 "2019-06-24T21:56:46Z")

</div>

Hi @clintandrewhall can you help on this issue?

---

<div class="post-metadata">

**Author:** ![Inammathe\_Inna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inammathe_inna/32/40656_2.png) [@Inammathe\_Inna](https://discuss.elastic.co/u/Inammathe_Inna)\
**Post date:** [June 26, 2019, 3:18am UTC](https://discuss.elastic.co/t/format-number-as-money-in-canvas/187198/3 "2019-06-26T03:18:17Z")

</div>

Figured it out!

I had to use the expression editor and just had to add this line to format the number using numeral.js:  
`| formatnumber format='$0,0[.]00'`

so the whole expression would look something like this:

```auto
filters
| essql
  query="SELECT ROUND(dollar_amount, 2)
FROM \"index\""
| math "metric"
| formatnumber format='$0,0[.]00'
| metric ""
  metricFont={font size=48 family="'Open Sans', Helvetica, Arial, sans-serif" color="#000000" align="center" lHeight=48} 
  labelFont={font size=14 family="'Open Sans', Helvetica, Arial, sans-serif" color="#000000" align="center"}
| render

```

Thank god you guys included autocomplete functionality in that editor for 6.5.4 haha

Cheers

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 24, 2019, 3:30am UTC](https://discuss.elastic.co/t/format-number-as-money-in-canvas/187198/4 "2019-07-24T03:30:37Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
