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:
But in our case, when the user got the email, the total days coming as a decimal number like below:
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.
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.
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.
Now on the “send an email” action, we will use the output of Compose 2 instead of the total days like below:
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.
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).
After submitting the task report in SharePoint List, the Manager will get the notification. For this, here is our Flow:
But in our case, when the manager got that mail, the Completed task is coming as a decimal number like below:
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.
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 ).
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.
Now we will use this output(output of the compose2) at the Send an Email action.
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:
This is how to convert a decimal number to a percentage in Power Automate flow.
Read Microsoft Flow delete all files in a folder
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:
- How to move files from OneDrive to SharePoint using Power Automate
- Scheduled cloud flow Example
- Power Automate Delete all items in SharePoint list
- How to Create CSV in SharePoint using PowerApps and Power Automate
- Save my email attachments to a SharePoint document library Power Automate or Flow
- SharePoint auto generate column value using Power Automate or Flow
- Power Automate dynamic content
I am Bijay a Microsoft MVP (8 times – My MVP Profile) in SharePoint and have more than 15 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com