cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
azeesdinu
Level: Powered On

Convert Hours in to Days and hour

Hi All.
I wanted to convert hours into days and hour. Ex - 75 into 3 days 3 hours.
I'm trying to achieve div(75,24) = 3.125.
I get the fraction value(.125) using split function.
Multiply reminder with 24 like mul(24,.125) but Mul expression does not accept the fraction value.
Please let me know how to convert hours into Days and hours

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Convert Hours in to Days and hour

Hi @azeesdinu 

The below expression should give you the output you need (where 75 is an example number of hours that can be replaced with a dynamic value).

 

concat(int(div(75,24)),' days and ',mod(75,24),' hours')
 
int(div(75,24)) will get the number of full days as an integer value removing the decimals. mod(75,24) will give you the remaining number of hours. 
Hope that helps.
 
 

Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Follow me on Twitter at @QG_LeeJHarris

Or on LinkedIn at in/leejharris

View solution in original post

2 REPLIES 2
Highlighted
LinkeD365
Level: Powered On

Re: Convert Hours in to Days and hour

Think you just need to use the mod function

 

mod(75, 24) gives you 3

 

https://docs.microsoft.com/en-gb/azure/logic-apps/workflow-definition-language-functions-reference#m...

Super User
Super User

Re: Convert Hours in to Days and hour

Hi @azeesdinu 

The below expression should give you the output you need (where 75 is an example number of hours that can be replaced with a dynamic value).

 

concat(int(div(75,24)),' days and ',mod(75,24),' hours')
 
int(div(75,24)) will get the number of full days as an integer value removing the decimals. mod(75,24) will give you the remaining number of hours. 
Hope that helps.
 
 

Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Follow me on Twitter at @QG_LeeJHarris

Or on LinkedIn at in/leejharris

View solution in original post

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Users online (4,750)