using Rule to convert minutes into tenth of minutes - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

using Rule to convert minutes into tenth of minutes

Last post 10-05-2010 07:28 AM by Jimmy. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-09-2010 12:10 PM

    using Rule to convert minutes into tenth of minutes

    I have a from that lets user to enter hours and quarter minutes, but I need to convert them into tenth of minutes and put the new number back to the textbox.

     I am new to infopath but not sure how to use Rules to do that or if it's possible at all.

    Basically, if user enters 0.15, I convert the input to 0.3 or if user enters 12.44, I convert it to 12.8.

    Tenths   Minutes
    0.1        1-6
    0.2        7-12
    0.3        13-18
    0.4        19-24
    0.5        25-30
    0.6        31-36
    0.7        37-42
    0.8        43-48
    0.9        49-54
    1.0        55-60

  • 10-05-2010 05:29 AM In reply to

    Re: using Rule to convert minutes into tenth of minutes

    Add two fields: one for minutes (int) and one for the calculation (decimal). Add a default value for the calculated field (minutes/60). Then add conditional formatting such that the calculated field is hidden when the minutes is blank, and the minutes is hidden after the user enters a value. You have two fields, but display only one at a time.
    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 10-05-2010 07:28 AM In reply to

    Re: using Rule to convert minutes into tenth of minutes

    I think it could be confusing for users to have the time change right from under them in one field.  Perhaps it would be easier and less confusing to have the time with tenths of minutes in a separate field and show them both, making the calculated one read-only?

     Your description of the problem is rather confusing.  You want to conver from minutes to tenths of hours, right?  And in your example, 12.44 is 12 hours, 44 minutes, and 12.8 is 12.8 hours, right?

     If my understanding of the above is correct, you can calculate the value you want using this formula, assuming that users use . (dot) as the separator character:

    ceiling((substring-before(time, '.') + substring-after(time, '.') div 60) * 10) div 10

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.