Skip to main content

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.environs"<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", psnip]
"currency_locale":"en_US", # Currency Locale | Valid inputs: "en_US", tsnip]
"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"]
s{"input":"100"}]
#etc..

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

l{'output':''}]

 

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

 

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.


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}"

 


Hi ​@noice 

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

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


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.


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.


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

 


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.


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.

 


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.