How to Format Numbers to Decimal Places Using Power Automate?

Do you want to format numbers to decimal places using Power Automate flow? Then, this Power Automate tutorial will show you how to Format Numbers with Decimal Places using Power Automate Flow.

Scenario:

Recently, I got a requirement to format the numbers with decimal places using Power Automate flow. For example, When the user inputs the value 1234, and I want to format the input value with one decimal place, then the output will be 123.4; similarly, for two decimal places, the output will be 12.34.

Here, I will show three examples to format a number with Decimal Places in Power Automate.

In the first example, we will use the Format number action to format a number with a Decimal Place using flow.

In the second example, we will use the format-number function to format a number with Decimal Place using flow.

Finally, I will show you how to get the number value from the SharePoint online list, format it with the Decimal Places, and update the SharePoint list field with formatted decimal value using Power Automate.

Before creating a flow, we have to know what standard formats are available to display a number with decimal places.

The Standard format ‘F’ (Fixed-point)supports the Format Number action and the format-number function in Power Automate and formats the number with decimal places.

FormatExpressionNumberOutput
FformatNumber(2,’F’)22.00
F0formatNumber(2,’F0′)22
F1formatNumber(2,’F1′)22.0
F2formatNumber(2,’F2′)22.00
F3formatNumber(2,’F3′)22.000

Now, we will create a flow to format a number value with Decimal Places using Power Automate flow.

Power Automate Format Number to Decimal Places

Let us see how we can Format Numbers with decimal places using Power Automate flow.

Example-1: (Using Format Number action)

Here, we will see how to format a number value with decimal places by using the Format Number action with two different formats in Power Automate flow.

  • Standard Format
  • Custom Format
See also  How to merge pdf files in Power Automate?

Step-1:

Create an instant cloud flow, expand the trigger action, and add a Number input as below:

power automate format number decimal places

Step-2: (Standard Format)

Add a new step and choose the Format Number action from the action trigger. Provide the required parameters.

  • Number – Pass the dynamic content of the number input
  • Format – Now choose the Standard format ‘F3’, which formats the input number value with decimal places.
  • Locale – Is an option field (Used to format the number)
triggerBody()['number']
format number decimal places in Power Automate

Step-3:

Save and Run the flow. Enter the number input and choose the run flow option

format number decimal places in Power Automate flow

Once the flow runs successfully, we can see that the number value is formatted with a decimal value in the expected output section.

Here, I have given the input value as 4.234579 and selected the Fixed Point format F3, so it rounds up and displays the output value as 4.235

How To Format A Number with decimal places In Power Automate

Step-4: (Custom Format)

Custom Format – Decimal Point Placeholder uses #.00 format,

Follow the (step-2) in the format number action, in the format option, choose the Custom value and pass the #.00 as highlighted below:

triggerBody()['number']
How To Format A Number with decimal places In Power Automate flow

Save and Run the flow, Here I have entered the input value as 9.2375930.

Format A Number with decimal places In Power Automate flow

Once the flow runs successfully, we can see it displays the output value as 9.24.

Format A Number with decimal places In Power Automate

This is how to format a number value with decimal places by using the Format Number action with two different formats in the Power Automate flow

Example-2: (Using Format Number Function)

Now we will see how to format a number value with decimal places by using the Format Number function in Power Automate flow

Step-1:

Create an instant cloud flow, expand the trigger action, and add a Number input as below:

power automate format number decimal places

Step-2:

Add a compose data operation, and pass the below expression to format a number value with decimal places under the Expression tab.

formatNumber(triggerBody()['number'], 'F1')

Where,

  • formatNumber – function name
  • number – input value
  • F1 – Standard Fixed Point format
Format A Number with decimal places using Power Automate

Step-3:

See also  Power Automate Increment Variable

Save the flow. Enter the number input and choose the run flow option.

Number Formatting with decimal places in Power Automate

Once the flow runs successfully, we can see that the number value is formatted with the decimal place value in the expected output section.

Here, I have given the input value as 2.88 and selected the Fixed point format F1, so it rounds up the value and displays the output value as 2.9

Number Formatting with decimal places in Power Automate flow

This is how to format a number value with decimal places by using the Format Number function in Power Automate flow

Power Automate Format Number to 2 Decimal Places

Using Power Automate flow, let us see how we can Update the SharePoint list field with a Formatted Number with 2 Decimal Places Value.

In this example, I am going to use the below SharePoint Products list, consisting of,

Column Name
Column Type
ProductNamedefault title column
ProductPriceNumber column
ProductStatusChoice column
ProductPricewith2DecimalPlacesText type
power automate format number 2 decimal place

To achieve this, follow the below steps:

Step-1:

Create an automated cloud flow, and select the trigger When an item is created or modified action and provide the required Parameters as highlighted below:

  • Site Address – From the dropdown, select the SharePoint site address
  • List – Choose the list name from the dropdown. (Here, I have selected my SharePoint Products List)
format number 2 decimal place in Power Automate

Step-2:

Add a compose data operation, and pass the below expression to format a number value with the two decimal places under the Expression tab.

formatNumber(triggerOutputs()?['body/ProductPrice'],'#.00')

Where,

  • formatNumber – function name
  • ProductPrice – SharePoint column internal name
  • #.00 – Custom format for fixed point with 2 decimal places
format number 2 decimal place in Power Automate flow

Step-3:

Select an Update item action and configure the required parameters:

  • Site Address – Select the SharePoint site address from dropdown
  • List – Select the list name from the dropdown. (I have selected my SharePoint Products List)
  • ID– Select the ID from the dynamic content value
  • Title – From the dynamic content, choose the title value
  • ProductPricewith2DecimalPlaces – From the dynamic content, Pass the outputs of the compose data operation, which formats the number value with the two decimal places.
format number 2 decimal place using Power Automate flow

Step-4:

See also  How to Create a Word Document from a SharePoint list item using Power Automate?

Save the flow. The flow will trigger only when the new item is added or modified to the SharePoint list.

In the below screenshot, you can see that I have added the new item with a Product Price value of $238

How to format number 2 decimal place in Power Automate flow

Once the flow runs successfully like below:

How to format number 2 decimal place in Power Automate

The number value is formatted with 2 decimal places and updates the values in the SharePoint list ProductPricewith2DecimalPlaces field.

How to format number 2 decimal place using Power Automate

This is how to Update the SharePoint list field with a Formatted Number with 2 Decimal Places Value using Power Automate flow.

Conclusion

I hope you know how to format number decimal places using Power Automate flow.

I have clearly shown you different examples of formatting numbers with decimal places in Power Automate flow.

In the first example, I have explained format numbers with decimal places with Standard Format and Custom Format using Format Number Action in Power Automate.

In the second example, I have explained format numbers with decimal places in Standard Format using the Format Number function in Power Automate.

In the other example, I have explained format numbers with decimal places in Custom Format using the Format Number function and Updated the SharePoint list field with Formatted two decimal places Value using flow.

You may also like:

>