• Instructions to Ask a Question

    Click on the "Ask a Question" button and select the application for which you would like to ask questions.

    We have 5 different products namely - Pabbly Connect, Pabbly Subscription Billing, Pabbly Email Marketing, Pabbly Form Builder, Pabbly Email Verification.

    The turnaround time is 24 hrs (Business Hours - 10.00 AM to 6.00 PM IST, Except Saturday and Sunday). So your kind patience will be highly appreciated!

    🚀🚀Exclusive Discount Offer

    Just in case you're looking for any ongoing offers on Pabbly, you can check the one-time offers listed below. You just need to pay once and use the application forever -
     

    🔥 Pabbly Connect One Time Plan for $249 (🏆Lifetime Access) -  View offer 

    🔥 Pabbly Subscription Billing One Time Plan for $249 (🏆Lifetime Access) - View offer

How to replace a zero with the number 1, but not in the middle of a number.

karilynae

Member
I'm using Text formatter: replace text to look for a zero and replace it with a 1. But I only want to replace it if the number is actually zero, not in the middle of a number like 205. Is there a way to do this?
 

ArshilAhmad

Moderator
Staff member
Hi @karilynae,

Please try using this Python code to achieve your use case.
1723146456359.png


Python:
def replace_zero(num):
    # Check if the number is exactly 0
    if num == 0:
        return 1
    else:
        return num

# Test cases
print(replace_zero(205))

 
Top