How to convert decimal to whole number in Power Automate + convert decimal to percentage

In this Microsoft Power Automate Tutorial, we will discuss how to convert decimal to whole number in Power Automate or Microsoft Flow.

We will also see, how to convert decimal to percentage in Power Automate or Microsoft Flow.

Also, you will be able to download the flow from the below download link.

Recently, we created a simple automated flow based on when an item is created in SharePoint, it will notify the user. We fetch this flow with a SharePoint list having columns such as employee’s name(people column), leave type(choice column), start date & end date(date-time column).

Also, we have created a calculated column named total days to calculate the total days between the start date to end date.

After submitting the request, the user gets a successful email about request submission. For this, here is our flow:

Convert decimal to whole number in Microsoft flow
Convert decimal to the whole number in Microsoft flow

But in our case, when the user got the email, the total days coming as a decimal number like below:

Convert decimal to whole number in Power Automate Flow
Convert decimal to the whole number in Power Automate Flow

But this is not the correct way to return the total days in a decimal format. So here is the solution how to covert this decimal number to a whole number in Power Automate or Flow.

Read Power Automate SharePoint Get items filter query contains is not valid

Convert decimal to whole number power automate

First, we will add a compose action after the “When an item is created” action. For this, click on the down arrow between the two actions(When an item is created and send an email). Then it will show the options to add an action.

convert decimal to whole number power automate
Add an action between two actions

Click on that option, it will ask to choose an operation. Here we will search for compose operation on the search bar. And selects that action i.e (Compose – Data operation). Then as inputs, we will add dynamic content as “Total Days” from our SharePoint list.

Power Automate convert decimal to the whole number
Power Automate convert decimal to the whole number

Similarly, after this compose we will add another compose action where we will insert an expression that will convert the output of compose1 to the whole number.

To insert an expression, after add compose action, click on the expression instead of dynamic content, then insert the below expression on the formula bar and click on Update.

int(outputs('Compose'))
Microsoft flow convert decimal to the whole number
Microsoft flow convert decimal to the whole number

Now on the “send an email” action, we will use the output of Compose 2 instead of the total days like below:

How to convert a decimal number to the whole number in Power Automate Flow
How to convert a decimal number to the whole number in Power Automate Flow

Then Save the flow and test it. Now we can see the days converted to the whole number successfully like below. We can check it in our Outlook mailbox.

How to format decimal number to the whole number in Microsoft Flow
How to format decimal number to the whole number in Microsoft Flow

This is how to convert a decimal number to the whole number in Power Automate or flow. For your reference, we share this flow. You can download it from here.

Read Power Automate copy list item to another list with attachments

How to convert decimal to percentage Power Automate

Now, let us see, how to convert decimal to percentage in Power Automate or Microsoft Flow.

Recently, we have created a simple automated flow based on when an item is created in the SharePoint list, it will notify the user who submitted that item.

We connect this flow with our SharePoint list containing columns such as; Title(single-line text), Start Date & End Date(Date-time type), Completed(number type with percentage).

convert decimal to percentage power automate
convert decimal to percentage power automate

After submitting the task report in SharePoint List, the Manager will get the notification. For this, here is our Flow:

Power Automate convert decimal to Percentage
Power Automate convert decimal to Percentage

But in our case, when the manager got that mail, the Completed task is coming as a decimal number like below:

convert decimal to percentage in power automate
convert decimal to percentage in power automate

But this is not the correct way to return the completed report in decimal number instead of percentage. So here is the solution to convert decimal to percentage in power automate.

Also, check out, How to convert decimal to whole number in Power Automate

Convert decimal number to percentage in Power Automate

Now, let us see, step by step how to convert decimal number to percentage in Power Automate or Microsoft Flow.

Step-1:

First, we will add a “compose” action just after the “When an item is created” action. On that Compose, we will choose and add the completed in the input section ( by clicking on add dynamic content ).

Convert decimal number to Percentage in Power Automate
Convert decimal number to Percentage in Power Automate

Step-2:

Again, we will add another “Compose” action. Here we will add an expression that will Convert decimal numbers to Percentages.

To insert an expression, After adding the Compose action, click on Expression instead of Add dynamic contents. Then insert the below formula on that expression bar and click on Update.

formatNumber(outputs('Compose'),'P0')
Convert decimal number to Percentage in Power Automate flow
Convert decimal number to Percentage in Power Automate flow

Step-3:

Now we will use this output(output of the compose2) at the Send an Email action.

Convert decimal number to Percentage in Microsoft flow
Convert decimal number to Percentage in Microsoft flow

Then just Save the flow and test it. Now, we can see when the Manger or user got that mail the completed data is coming as a percentage:

Microsoft flow convert decimal to percentage
Microsoft flow convert decimal to percentage

This is how to convert a decimal number to a percentage in Power Automate flow.

Download Microsoft Flow Example

If you want to try the flow, then you can download it from here. Make sure to create the SharePoint list as shown in the above diagram.

In this tutorial, we discussed the below things:

  • How to convert decimal to whole number in Power Automate
  • How to convert decimal to percentage Power Automate

You may also like the following Microsoft flow articles:

>