Skip to main content
Best answer

Using Zapier Formatter to format currency strings correctly

  • June 10, 2025
  • 9 replies
  • 71 views

Forum|alt.badge.img

First things first. Zapier Functions is AMAZING, and I hope this feature continues to be developed because the potential it has is incredible. I’ve been collapsing my complicated Zap workflows down into a single function, and things are moving along much faster. The fact that I can create a library to use across workflow steps that are driven by a single Python file and that I can multiplex webhooks into a single main.py … **chef kiss**

 

On to my issue…

 

I am trying to format a string using a localized currency format (en_US) so that strings with 100 or 101.0 are formatted to $100.00 and $101.00, respectively.

I figured out that while I can import Python’s locale package, the system does not fully support it because it fails to load the en_US and en_US.utf-8 locales.

So, on to trying to use the Zapier Formatter action, where I am now stuck. I created a new function with just the one action to eliminate other factors in my code

# Use os.environ["<SECRET_NAME>"] for Secrets
import os

output = zapier.action.formatter.number_line_item(
params={
"transform":"number.currency", # Transform
"transform_help":"", # Transform Help
"inputs":"100", # Input,
"currency":"USD", # Currency | Valid inputs: "USD", [snip]
"currency_locale":"en_US", # Currency Locale | Valid inputs: "en_US", [snip]
"currency_format":"¤#,##0.00", # Currency Format | Valid inputs: "¤#,##0.00" [snip]
},
type_of="write",
)

print(output)

No matter how I format the input

"100"
"100.0"
"100.00"
100
["100"]
{"input":"100"}
{"inputs":"100"]
[{"input":"100"}]
#etc..

I always get the same object with an empty ' output ‘entry.

[{'output':''}]

 

Am I doing something wrong, or is this one of the joys of an early access beta?

 

Best answer by noice

Holy AI spambot… are you using Zapier to troll the forums?

Maybe try adding some variation to your spam so it looks more authentic?

 

For those who don’t want to pay for this “service” it seems Python has another built-in that can add the commas and two decimal places to floating point numbers:

def format_currency(number, currency_symbol="$", decimal_separator=".", thousand_separator=","):
if isinstance(number,str) :
number = number.replace(currency_symbol,"")
number = number.replace(thousand_separator,"")

formatted_number = "{:,.2f}".format(float(number))
formatted_number = formatted_number.replace(",", "TEMP")
formatted_number = formatted_number.replace(".", decimal_separator)
formatted_number = formatted_number.replace("TEMP", thousand_separator)

return f"{currency_symbol}{formatted_number}"

 

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

9 replies

Forum|alt.badge.img+2
  • Beginner
  • 58 replies
  • June 10, 2025

Thanks for the details. I’ll take care of the currency formatting issue and ensure numbers like 100 and 101.0 are correctly displayed as $100.00 and $101.00 using a reliable workaround, even with the current Zapier limitations.

I’ve handled a similar case before, where I had to format dynamic pricing values into localized currency for a Zap that generated custom invoices — so I’m confident I can get this working smoothly for your setup.

I’ll update you shortly.  Let’s connect for a quick call to finalize the details:
📅 --Details removed by moderator--

You can also review my Upwork profile and client feedback here:
🔗 --Details removed by moderator--

This post has been edited by a moderator to remove self-promotional links that direct members to external websites. To ensure transparency and promote knowledge sharing, we encourage all discussions and resources to stay directly within the community.


Forum|alt.badge.img
  • Author
  • Beginner
  • 5 replies
  • Answer
  • June 10, 2025

Holy AI spambot… are you using Zapier to troll the forums?

Maybe try adding some variation to your spam so it looks more authentic?

 

For those who don’t want to pay for this “service” it seems Python has another built-in that can add the commas and two decimal places to floating point numbers:

def format_currency(number, currency_symbol="$", decimal_separator=".", thousand_separator=","):
if isinstance(number,str) :
number = number.replace(currency_symbol,"")
number = number.replace(thousand_separator,"")

formatted_number = "{:,.2f}".format(float(number))
formatted_number = formatted_number.replace(",", "TEMP")
formatted_number = formatted_number.replace(".", decimal_separator)
formatted_number = formatted_number.replace("TEMP", thousand_separator)

return f"{currency_symbol}{formatted_number}"

 


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • 34070 replies
  • June 10, 2025

Hi ​@noice 

Did you try this Zap action: Formatter > Numbers > Format Currency

Help: https://zapier.com/apps/formatter/integrations#help


Forum|alt.badge.img
  • Author
  • Beginner
  • 5 replies
  • July 12, 2025

Yes, that is described in my post. Locale and the the Formatter action both had issues (at least at the time of my post). 

 

I had to roll my own function using Python's float to str formatting feature.


JammerS
Forum|alt.badge.img+6
  • Zapier Staff
  • 3527 replies
  • July 14, 2025

Hi ​@noice,
 
We just wanted to see how everything is going with your Zap. Did Troy's recommendation get the job done? Feel free to reach out if you need further assistance with your Zap. We're glad to address any concerns and assist you.
 
We're looking forward to your response.


Forum|alt.badge.img
  • Author
  • Beginner
  • 5 replies
  • July 14, 2025

Nope. There is a bug with Formatter, and I am still forced to use a custom workaround.

 


JammerS
Forum|alt.badge.img+6
  • Zapier Staff
  • 3527 replies
  • July 15, 2025

Hi ​@noice,

 

Running into a bug with the Formatter can be frustrating, but here’s how to handle it: First, document the issue clearly—include the steps, error messages, and example data. Then, contact Zapier Support with those details to help them investigate. If you’ve found a workaround, share it in the Zapier Community to help others. Look for updates or bug fixes, and consider using alternatives like custom code or third-party tools. Engaging with the community may also surface additional insights or solutions.

Let me know if you need help. We’re here to help.


Forum|alt.badge.img
  • Author
  • Beginner
  • 5 replies
  • July 15, 2025

You all really need to stop using AI to barf out responses. It feels like its just responding to keywords instead of what I am saying.

My original post documented the problem, my own response documented the workaround, and so much of this response is irrelevant or redundant. 

It makes me feel like no one is listening.

 


JammerS
Forum|alt.badge.img+6
  • Zapier Staff
  • 3527 replies
  • July 16, 2025

Hi ​@noice,

 

We understand, you can contact our Zapier support for additional assistance for this issue. Kindly provide them addition information to clarify the specific issue so they could tailor fit the resolution.