# Format monetary amount in list (not input!)

**URL:** https://community.weweb.io/t/format-monetary-amount-in-list-not-input/14562
**Category:** How do I?
**Tags:** design
**Created:** [November 16, 2024, 2:17pm UTC](https://community.weweb.io/t/format-monetary-amount-in-list-not-input/14562 "2024-11-16T14:17:02Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![BertrandG](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/bertrandg/32/5129_2.png) [@BertrandG](https://community.weweb.io/u/BertrandG)
#### Post date: [November 16, 2024, 2:17pm UTC](https://community.weweb.io/t/format-monetary-amount-in-list-not-input/14562/1 "2024-11-16T14:17:02Z")

</div>

There are some more or less helpful posts about **input** elements. But none is valid for an **output**. I got a list (table) with EUR and would like to

- use the **system locale** thousand separator
- display the **# of decimal places** (parameter stored in a database table; customer-specific).

Using the formula **round(toNumber(context.item.data?.[‘t\_total’]), 2)** has two issues:

- Integers are displayed without decimals
- All values use “.” although it should be “,” on a German PC  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/4/495379e49c0bb323768aa965865ee098d3485eba.png)  
How can I achieve this result:  
220,00  
250,62  
760,00

---

<div class="post-metadata">

### Author: ![Dominic](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/dominic/32/5645_2.png) [@Dominic](https://community.weweb.io/u/Dominic)
#### Post date: [November 16, 2024, 7:49pm UTC](https://community.weweb.io/t/format-monetary-amount-in-list-not-input/14562/2 "2024-11-16T19:49:53Z")

</div>

Hi @BertrandG,

In tables I usually use js formula:

return (new Intl.NumberFormat().format({{variable}}) in custom function…

---

<div class="post-metadata">

### Author: ![BertrandG](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/bertrandg/32/5129_2.png) [@BertrandG](https://community.weweb.io/u/BertrandG)
#### Post date: [November 18, 2024, 10:08am UTC](https://community.weweb.io/t/format-monetary-amount-in-list-not-input/14562/3 "2024-11-18T10:08:58Z")

</div>

Hi @Dominic,  
Great! With a little help of AI I found a suitable formula. Thank you!

const number = context.item.data?.[‘t\_total’];  
// Use Intl.NumberFormat to format the number as currency in de-DE format with EUR currency  
const formattedCurrency = new Intl.NumberFormat(‘de-DE’, { style: ‘currency’, currency: ‘EUR’ }).format(number);  
// Return the formatted currency value  
return formattedCurrency;

I will now replace the locale and symbol by **parameters** but this is easy.
