How to convert a Double to days hours minutes - InfoPath Dev
in

InfoPath Dev

How to convert a Double to days hours minutes

Last post 03-06-2015 08:50 AM by Caeanis. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 03-06-2015 08:50 AM

    How to convert a Double to days hours minutes

    I have a form that calculates the number of minutes for a given project.  Some may only take minutes, some hours, some several days.  I am wondering how to take an integer or double and return the corresponding days, hours, minutes etc.
    I have seen several posts that explain how to do the reverse which is convert date picker values to a number but I'm not sure how to go about this the other way.

    I think the basic logic would be:
    Round the double up to an integer:
    floor(Double)
    If this result is greater than 1440 (minutes in a day)
    days = floor(Double)/1440
    hours = ((floor(Double)/1440)-1140)/60
    minutes = (((floor(Double)/1440)-1140)/60)-60

    Not quite sure if this is right, and not sure how to write this formula. Any help would be appreciated.

    Marc

Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.