Skip to main content

Email automation returning currency format different from the grid

  • Sep 12, 2023 1:15 AM UTC
  • 5 replies
  • 241 views

Forum|alt.badge.img+2

Hello community,
Please, can someone explain (or where can I find the information) on how to add 2 decimal places after the comma in the currency format in email automation?
Thanks

This topic has been closed for replies.

5 replies

Forum|alt.badge.img+2
  • Author
  • New Participant
  • Sep 12, 2023 8:49 PM UTC

In the attached file you can see another example of what has happened to us in the values in the automated emails. Please, We need help from someone qualified to answer!!! Or, do we only have Administrators who delete posts that criticize Bugs like these on Airtable?


Forum|alt.badge.img+17
  • Inspiring
  • Sep 12, 2023 9:43 PM UTC

In the attached file you can see another example of what has happened to us in the values in the automated emails. Please, We need help from someone qualified to answer!!! Or, do we only have Administrators who delete posts that criticize Bugs like these on Airtable?


I haven't run into this problem myself, but it looks like this solution could work for you:

https://community.airtable.com/t5/automations/currency-format-in-email/m-p/41204#M1116

The solution is to add an extra step (a script) to the automation to format the currency value before it goes into your email.


Forum|alt.badge.img+2
  • Author
  • New Participant
  • Sep 24, 2023 10:59 AM UTC

I haven't run into this problem myself, but it looks like this solution could work for you:

https://community.airtable.com/t5/automations/currency-format-in-email/m-p/41204#M1116

The solution is to add an extra step (a script) to the automation to format the currency value before it goes into your email.


Hi @Andy_Lin1 @ thanks for this awesome code and example base!

But unfortunately the Script does not work with numbers below 1,000.00.

We are in a difficult situation here. Could you please tell us how we could correct this point or suggest other Codes that solve this?

Thank you very much for your willingness to help.


Forum|alt.badge.img+17
  • Inspiring
  • Sep 25, 2023 5:38 PM UTC

Hi @Andy_Lin1 @ thanks for this awesome code and example base!

But unfortunately the Script does not work with numbers below 1,000.00.

We are in a difficult situation here. Could you please tell us how we could correct this point or suggest other Codes that solve this?

Thank you very much for your willingness to help.


Is this the script you're using?
https://community.airtable.com/t5/automations/currency-format-in-email/m-p/41210#M1122

The regular expression in the script should work for numbers below 1000. Can you show what's happening with those numbers and how they should look instead?


Forum|alt.badge.img+8
  • Known Participant
  • Sep 26, 2023 2:27 AM UTC

@Andy_Lin1  is correct, you need to add a Run script automation step before the email step. You need to pass each number you want to as an Input variable. Use something like this in the script:

 

const formatter = new Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' }); Object.entries(input.config()).forEach(([k, v]) => { output.set(k, formatter.format(v)); });

 

Then use that script step's output variables in your email content (instead of the original record's values).