Have you ever needed to do calculations in Power Automate but realized your number is stored as text? That happened to me recently while working on a leave management application. In one of the flows, when someone applied for leave with a half-day option, the system stored it as text instead of a number.
This created a problem because I needed to accurately calculate the total leave days. After one change, I successfully converted the string into a decimal, which worked perfectly!
In this tutorial, I will tell you how to convert a String to a Decimal Number in Power Automate.
Decimal Function in Power Automate
The decimal function in Power Automate is used when you want to convert a number or text into a decimal format. It’s helpful if you’re working with values that need precise calculations, like money, measurements, or percentages.
Syntax:
decimal('<value>')
- Input: You can give it a number or a string ( “12.345”).
- Output: It will give you a proper decimal value (12.345).
Convert a String to a Decimal Number in Power Automate
Suppose you have a SharePoint list called “Orders” that tracks customer orders. One of the columns, “Price,” is stored as a string.

You aim to calculate the Total Cost by multiplying the item price by the Quantity (a number column). Since “Item Price” is a string, you need to convert it to a decimal number before performing the calculation.
Now follow the below steps:
1. Create an Automated Cloud Flow using the SharePoint connector’s ‘When an item is created‘ trigger. Select the SharePoint site where your ‘Orders‘ list is located, and choose the ‘Orders‘ list.

2. Add an “Initialize variable” action to store the item price as a decimal.
- Name: varItemPrice
- Type: Float

3. Use the “Set Variable“ action to assign the decimal value to the varItemPrice variable.
- Name: select varItemPrice
- Value:
decimal(triggerBody()?['Price'])This converts the string value in the “Price” column to a decimal number.

4. Add a “Compose” action to calculate the total cost and provide the below expression:
mul(triggerBody()?['Quantity'],variables('varItemPrice'))
5. Use the “Update item” action to update the “Total Cost” column in the SharePoint list with the calculated value.
- Site Address: Select the SharePoint site address in your Orders list.
- List Name: choose the ‘Orders’ list from the drop-down.
- Id: Provide ID from dynamic content when an item is created.
- Total Cost: Set the Total Cost column to the output of the Compose action.

Save the flow and run it manually. Then, go to the SharePoint list and add a new item.

After the flow runs successfully, refresh the SharePoint list. The value will be updated in the ‘Total Cost’ column.

Conclusion
In this tutorial, I told decimal functions in Power Automate and how to convert a string to an integer in Power Automate, which is useful when working with data that needs numerical calculations.
- Convert String to GUID in Power Automate
- Convert Float to Integer in Power Automate
- Convert CSV to Excel Using Power Automate
- Save Email Attachment to SharePoint Using Power Automate
- Power Automate IF Expression

After working for more than 18 years in Microsoft technologies like SharePoint, Microsoft 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (12 times). I have also worked in companies like HP, TCS, KPIT, etc.