Sep 11, 2023 06:15 PM
Sep 12, 2023 01:49 PM - edited Sep 12, 2023 01:51 PM
Sep 12, 2023 02:43 PM
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.
Sep 24, 2023 03:59 AM
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.
Sep 25, 2023 10:38 AM
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?
Sep 25, 2023 07:27 PM - edited Sep 26, 2023 08:19 PM
@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).