Skip to main content
Best answer

How do I format numbers in US notation when creating invoices with Mollie integration through Zapier?

  • Jan 31, 2024 2:22 PM UTC
  • 5 replies
  • 143 views

Forum|alt.badge.img+1

Hello,

 

I use zapier to create my invoices with the corresponding payment link through the Mollie intergration.

Now I need to use the US number notation. So 1,200.50 instead of the Dutch 1,200.50.

I had solved this by replacing the , with a dot, this works when the number stays below 1000. So 150,00 becomes 150.00.

Above 1000 this is not going to work because then you have both a , and a .. Do any of you know how I can modify this so that correct payment links are created? Now amounts above 1000 are created incorrectly.

 

 

Best answer by Waggie

Hello Ken.A,

 

Thx for your response! I just found a easier way to do this. See printscreen, now it works!

 

Action you need to change to Format number and then you can choose to switch a Comma for grouping and period for decimal!

 

 

View original
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

5 replies

Forum|alt.badge.img+1
  • Author
  • Beginner
  • Jan 31, 2024 2:36 PM UTC

 


Forum|alt.badge.img+1
  • Author
  • Beginner
  • Jan 31, 2024 2:36 PM UTC

 


ken.a
Forum|alt.badge.img+6
  • Zapier Staff
  • Feb 1, 2024 9:53 AM UTC

Hi there @Waggie,

It looks like we’re going to need the Code by Zapier step for this to be possible. I asked ChatGPT about the code that we’re going to use and here’s how to achieve this:

  1. Add the Code by Zapier action step.
  2. Choose the “Run Javascript” event.
  3. Type “Number” in the “Input Data” field and map the number to the right field.
  4. Copy and paste this code to the “Code” field:
    const originalNumber = inputData.number; // Assuming 'number' is the field with your amount // Replace Dutch format with US format // First remove the period used for thousands, then replace the comma with a period let formattedNumber = originalNumber.replace(/\./g, '').replace(/,/g, '.'); output = [{formattedNumber}];
    a3db31017fd8b65c6d917b24238eaa68.png
    (view larger)
     
  5. Here’s the result:
    89c406e2172f3ca435004e851e7f6e5f.png
    (view larger)

Hopefully, this helps!


Forum|alt.badge.img+1
  • Author
  • Beginner
  • Answer
  • Feb 7, 2024 1:00 PM UTC

Hello Ken.A,

 

Thx for your response! I just found a easier way to do this. See printscreen, now it works!

 

Action you need to change to Format number and then you can choose to switch a Comma for grouping and period for decimal!

 

 


ken.a
Forum|alt.badge.img+6
  • Zapier Staff
  • Feb 8, 2024 9:00 AM UTC

That’s really awesome @Waggie! You’re definitely correc! Using Numbers in Formatter by Zapier is easier.

Also, thank you for sharing your solution here. I really appreciate it!

Happy Zapping! ⚡️