Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Solution
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

Get a decimal result when dividing numbers in Power Automate

Posted on April 6, 2022April 10, 2022 by Tom

“I’m dividing two numbers to convert ticks to days but Power Automate gives me only full days as a result, ignoring the decimal numbers!”


If you divide numbers in Power Automate, e.g. to convert ticks to days to get a time difference, you’ll use the div(…) expression. But there’s a small inconvenience using it. By default, if you divide two whole numbers, it’ll return a whole number. It won’t return a decimal result, just the whole number part. Instead of 0.5 you’ll get a 0, instead of 2.3 you’ll get 2, etc. That’s not very helpful, especially if you’re trying to calculate some percentages.

How do you then tell it to return also the decimal part of the result?

Use decimal number as an input

The reason is that the expression keeps the input data type. You entered two whole numbers (integers), it’ll return another whole number (integer).

Since the expression sticks to the original input type, you must change the input. Instead of using two whole numbers convert one of them into a decimal number (float). Applying the float(…) expression will convert the input number, and together with that also the division result. It doesn’t matter which input it’ll be, you can pick any of them.

float(<number>)

Note: <…> is a placeholder, replace it including the < and >.

Following with the example from above, the difference between now and 12 hours ago is 0.5 days, not a 0.

Power Automate dividing numbers decimal

Summary

When dividing numbers in Power Automate, you should always consider converting one of them into a decimal number (float). The result will be another decimal number and you won’t miss any piece of information (especially if you’re trying to calculate percentages).


πŸš€ Master Power Automate

Join 2,100+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

2 thoughts on “Get a decimal result when dividing numbers in Power Automate”

  1. Krishna says:
    July 23, 2023 at 1:17 pm

    Need your suggestion.

    I am using SP document library for review purpose. I need to send email notification to users based on the “Review date”.

    My action items, email need to send every 7 days based on the Review date. Example, my document review date is today means, an email notification need to send today, after that incase if document not review means, again email notification need to send next 7 days. Like that until the document reviewed, every 7 days email notification need to send users.

    Example: suppose document review date 2023-07-23. Incase users missed to review then email notification need to send on 2023-07-30. Similar again if not review on 30th also another email notification need send 2023-08-06. Again of not review on 6th also another email need to send on 2023-08-13 and soon, until document review date changed.

    Means based on review date it need to calculate past 7days date and send email something like

    Note: Document review date fix and user will change manually. Please suggest us how to crack this functionality. I tried my way. Your suggestions are highly appreciations.

    Reply
    1. Tom says:
      August 13, 2023 at 9:01 pm

      Hello Krishna,
      I’d probably do it as explained here: https://tomriha.com/send-multiple-sharepoint-reminders-in-a-single-power-automate-flow/

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

πŸš€ Master Power Automate

Join 2,100+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Still exchanging emails to get things approved?

Get the Approval Process solution to skip the hard part and deploy an automated, fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Are your approvals stuck due to unavailable approvers?

Keep your approvals running with the Approval task delegation app! Reassign any existing approval task to another user with a single click - no more waiting for absent approvers!

Power Automate approval task delegation ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundleβ€”everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes