# Displaying currency format on a table/grid

**URL:** https://community.weweb.io/t/displaying-currency-format-on-a-table-grid/4311
**Category:** Ask us anything
**Tags:** design, xano
**Created:** [September 12, 2023, 5:29pm UTC](https://community.weweb.io/t/displaying-currency-format-on-a-table-grid/4311 "2023-09-12T17:29:44Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![lebom326](https://avatars.discourse-cdn.com/v4/letter/l/2bfe46/32.png) [@lebom326](https://community.weweb.io/u/lebom326)
#### Post date: [September 12, 2023, 5:29pm UTC](https://community.weweb.io/t/displaying-currency-format-on-a-table-grid/4311/1 "2023-09-12T17:29:44Z")

</div>

How do I show number as currencies on a table, e.g. 1,000.00 instead of 1000.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/e/ebcce9c3f7ff2d271832937ac4b98429e212d19d.png)

I need to show the Balance as 500,000.00 instead of what is in the picture (500000). The data comes from Xano.

Please assist.

---

<div class="post-metadata">

### Author: ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)
#### Post date: [September 12, 2023, 6:17pm UTC](https://community.weweb.io/t/displaying-currency-format-on-a-table-grid/4311/2 "2023-09-12T18:17:30Z")

</div>

You need to format it via custom functions I think.

---

<div class="post-metadata">

### Author: ![lebom326](https://avatars.discourse-cdn.com/v4/letter/l/2bfe46/32.png) [@lebom326](https://community.weweb.io/u/lebom326)
#### Post date: [September 12, 2023, 6:36pm UTC](https://community.weweb.io/t/displaying-currency-format-on-a-table-grid/4311/3 "2023-09-12T18:36:45Z")

</div>

Not sure how; please assist.

---

<div class="post-metadata">

### Author: ![lebom326](https://avatars.discourse-cdn.com/v4/letter/l/2bfe46/32.png) [@lebom326](https://community.weweb.io/u/lebom326)
#### Post date: [September 13, 2023, 7:19am UTC](https://community.weweb.io/t/displaying-currency-format-on-a-table-grid/4311/4 "2023-09-13T07:19:17Z")

</div>

Hi Broberto,

Thank you for the hint. I asked ChatGPT to create a JavaScript function with the following prompt:

“Create a JavaScript function to format a number, round it off to two decimal places, and add commas as thousands separators”

The results were the following:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/8/87e89e9682e57ffa28151c407866f56d4d2cd7d6.png)

I then created a Formula in WeWeb called toCurrency with the following options:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/7/7c684493e092fd05bd0748a43fa1e260906ec813.png)

To use the formula in my table, I just put it in front of the number that I would like to format, as follows (see yellow highlighted):

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/2/2c30c6c747c1b718cd482540ca7215487c2b6d80.png)

Thanks, today I have learnt something awesome and will incorporate JavaScript in my web app, with the assistance of AI (ChatGPT or Code Llama 😉).

---

<div class="post-metadata">

### Author: ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)
#### Post date: [September 13, 2023, 7:30am UTC](https://community.weweb.io/t/displaying-currency-format-on-a-table-grid/4311/5 "2023-09-13T07:30:51Z")

</div>

You can also use copilot for this. He is trained to do exactly this, while other models are more generalist.
