Converting decimal to hours:minutes format - InfoPath Dev
in

InfoPath Dev

Converting decimal to hours:minutes format

Last post 10-19-2010 08:51 PM by zumetabo. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-19-2010 02:12 PM

    Converting decimal to hours:minutes format

    I have a situation where I have to take a column of minute amounts and represent them at the bottom of the column in a hours:minutes format.  I am almost there but need one last bit of advise to get me over the hump.  I'll explain where I am:

     The fields where minutes are to be entered are text boxes set to contain whole numbers.  I have a field (data type is decimal) that adds all of the minute fields in the column & divides them by 60. 

    Here is where the problem comes in. I have a the field at the bottom of the column that uses the following formula,  concat(substring-before(AdlMonTotal, "."), ":", substring-after(AdlMonTotal, ".") * 60)

    The formula works fine except I can't limit the amount of characters after the colon so there are always three digits.  If the amount of time is one hour, thirty minutes it is represented as "1:300".  Even worse, if the amount of minutes is two then it is represented as 0:199999999 (repeating). 

     So I suppose my question is, how do I fix my formula so the amount of minutes are represented properly?  Thanks very much!

    Filed under: , ,
  • 10-19-2010 07:19 PM In reply to

    Re: Converting decimal to hours:minutes format

    How about this:

    Converting decimal to time

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 10-19-2010 08:51 PM In reply to

    Re: Converting decimal to hours:minutes format

    Worked great, I'm surprised I missed that post earlier. 

    Anyways, thanks very much for your help!

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