Format monetary amount in list (not input!)

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

    How can I achieve this result:
    220,00
    250,62
    760,00

Hi @BertrandG,

In tables I usually use js formula:

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

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.