web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Convert numeric hours ...
Power Apps
Answered

Convert numeric hours to text hours

(0) ShareShare
ReportReport
Posted on by 98

Good afternoon.

I'm trying to convert my hours in numeric format to string format hh:mm.

I am using this code

 

 

With(
 {
 wFindSplit: Find(
 "";
 ThisItem.'Quantidade de horas'
 );
 wLenTxt: Len(ThisItem.'Quantidade de horas')
 };
 Left(
 ThisItem.'Quantidade de horas';
 wFindSplit
 ) & ":" & Round(
 Value(
 Right(
 ThisItem.'Quantidade de horas';
 wLenTxt - wFindSplit
 )
 ) *60;
 0
 )
)

 

 

Horas numérica.png

Categories:
  • WarrenBelz Profile Picture
    156,963 Most Valuable Professional on at

    @Fioravanti ,

    It should be something like this

    With(
     {
     _Hours:
     RoundDown(
     ThisItem.'Quantidade de horas',
     0
     )
     },
     Text(_Hours, "00") & ":" & 
     Text(
     Round(
     Mod(
     ThisItem.'Quantidade de horas',
     _Hours
     ) *60,
     2
     ),
     "00"
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Fioravanti Profile Picture
    98 on at

    The hours solved it, now the minutes didn't solve it.

    It did not bring the value I selected.

    In other words, I selected 23:35, the result came to me at 23:01

  • Verified answer
    WarrenBelz Profile Picture
    156,963 Most Valuable Professional on at

    @Fioravanti ,

    Left a bit out - try now

  • BohdanLev Profile Picture
    9 on at

    Hello,

     

    Let me give you few hints:

     

    1 - in line 4 are do you miss to find separator like "." or "," because in your code there is ""

    2 - do you have your numeric value 'Quantidade de horas' as number? If yes then you should use it as number , if not this is strange but still you can transform it to number using Value() like Value("34.4")

     

    So I would simplify the code like this 

    With( 
     //arg
     {hourValue: 32.5};
     // round to integer number
     Text(RoundDown(hourValue;0)
     ) 
     & ":" &
     // decimal value after separator muitiplied by 60 minutes to round to integer
     Text(Round((hourValue - RoundDown(hourValue;0)) * 60;0))
    )

     

    >> returns "32:30"

     

    Let me know

  • Fioravanti Profile Picture
    98 on at

    You are the best.

    @WarrenBelz 
    I have a lot of difficulty with these time conversions.

     

    It worked perfectly, once again. thank you very much
    ​

  • CarlosFigueira Profile Picture
    Microsoft Employee on at

    Another way to format the number of hours in the hh:mm format would be to use something like the expression below:

    Text(Time(0, ThisItem.'Quantidade de horas' * 60, 0), "hh:mm")

    Hope this helps!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 224 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 126

Last 30 days Overall leaderboard