Displaying currency format on a table/grid

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

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.

You need to format it via custom functions I think.

Not sure how; please assist.

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:

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

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):

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

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

2 Likes