Converting decimal to time - InfoPath Dev
in

InfoPath Dev

Converting decimal to time

Last post 01-24-2014 02:30 AM by AnnaGell. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 09-18-2010 08:29 PM

    Converting decimal to time

    Hi guys, I was wondering if any of you knew how to convert a decimal number to to time? I'm creating a time-sheet and to find the difference between two times I've converted them to seconds and then subtracted one from the other - then divided the result by 3600. I would like to convert this back to a time format so it's a bit easier to see how long you've been at work. So for example: 0.48 would look like this 0:28 1.82 would look like 1:49 It's probably fairly easy but I just can't figure it out! Any help would be greatly appreciated.
  • 09-18-2010 10:58 PM In reply to

    Re: Converting decimal to time

    How's this:

    concat(floor(my:hours), ":", substring("0", 1, 1 * ((my:hours * 60 mod 60) < 10)), floor(my:hours * 60 mod 60))

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-18-2010 11:06 PM In reply to

    Re: Converting decimal to time

    Beautiful! I cannot thank you enough for your help!
  • 01-24-2014 02:30 AM In reply to

    Re: Converting decimal to time

    Hi, is there any way to make this work if the original decimal could also be a negative? ie: 3.42 --> 3:25 & -3.42 --> -3:25
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.