Live training: next batches coming soon. Join the waitlist:Waitlists open:Developer Training →Developer →Copilot Studio Training →Copilot Studio →

2 Various Ways to Convert String to Decimal in Power Automate

When working in Power Automate, you’ll often need to convert data between different types. One common scenario is converting a string to a decimal. This is especially useful when dealing with numeric data stored as text, such as prices, quantities, or financial data extracted from a SharePoint list or Excel file.

For example, imagine you have a flow that processes order details from a SharePoint list where the price column is stored as a string. You’ll need to convert that string into a decimal to perform calculations like summing the total or applying discounts. Power Automate won’t treat the value as a number without this conversion, leading to errors or unexpected results.

In this tutorial, I will tell you how to convert string to decimal in Power Automate.

Convert String to Decimal in Power Automate

We can achieve this using two functions: float() and decimal(). Both functions serve similar purposes but have slight differences in behavior:

  • float(): Converts a string into a floating-point number. This is useful when you need a number with decimal precision.
  • decimal(): Converts a string to a decimal value with control over the number of decimal places.

Let’s see with the help of an example:

Example 1: [Convert String to Decimal in Power Automate Using float() Function]

Suppose you have a string value “49.99” that represents a price. Before performing any calculations (applying discounts), you must convert the string to a decimal format in Power Automate.

1. In Power Automate, create an Instant Cloud Flow by Manually trigger a flow.

power automate convert string to decimal number

2. Add an Initialize Variable action for storing string and provide below parameters:

  • Name: varInputString
  • Type: String
  • Value: 49.99
power automate convert string to decimal

3. Add a compose action and provide the below expression:

float(variables('varInputString'))
convert string to decimal power automate

4. Add another Compose action to apply a 10% discount:

mul(outputs('Compose'), 0.9)
How to convert string to decimal number Microsoft power automate

Save your flow and run it manually. Check the output of the Compose actions:

  • The first Compose will show the decimal:
How to convert string to decimal number power automate
  • The second Compose will show the discounted: