Often when you are working with Zapier, you will need to format numbers and text in a variety of ways. In this post, we will show you how to divide numbers.
Checkout Page stores prices in cents, so if you want to show the price in dollars or another currency, you often need to divide the number by 100. Formatter can help you with that.
In this example, we will divide the price by 100 and show the result in dollars.
What is Zapier Formatter?
Formatter is a native Zapier tool that allows you to format numbers and text in a variety of ways within Zaps. You can use it to divide numbers, round numbers, add or remove text, and much more. Formatter is generally used in a multi-step Zap to format data from one app before you send it to another app.
Formatter by Zapier can make these four transformations:
- Number
- Text
- Date / time
- Utility
The number transformation allows you to round numbers, divide numbers and make calculations. The text transformation allows you to add or remove text, convert text to uppercase or lowercase, and so on. The date / time transformation allows you to convert dates and times to different formats. The utility transformation allows you to generate random numbers and generate random text.
How to divide numbers with Zapier Formatter
- Create a new Zapier Zap
- Select a trigger to run the Zap on (we will use Checkout Page > New payment)
- For the Action, select Format
- For Event, select Numbers
- In Transform, use Perform Math Operation
- Select Divide
- Select or enter your first Input. We will use "Amount" from Checkout Page, which is "100"
- Select or enter your second Input. We will use "100" to divide the first input by 100
- Click Test action to run the Formatter & check if the output is correct. In our example, the output should be 1
From here, you likely want to add another Step to your Zap, such as sending an email with the output or storing it in a CRM or Spreadsheet.
Ways to use Zapier Formatter
Quite often you'll need to format data before you send it to another app. These are some of the most common ways to use Zapier Formatter:
- Divide, subtract, sum and multiply numbers
- Round numbers
- Convert numbers to Currency
- Add or remove text
- Convert text to uppercase or lowercase
- Convert dates and times to readable formats
- Generate random numbers & text
As you can see, Zapier Formatter can do a lot. We went over one of the most common uses for Checkout Page, but you'll likely find many other ways to use it.