Converting time to Decimal - InfoPath Dev
in

InfoPath Dev

Converting time to Decimal

Last post 01-10-2014 10:59 AM by recono1. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-09-2014 12:13 PM

    Converting time to Decimal

    I am trying to do this in InfoPath 2013 and it is not working I have a field with a time OperationalTime and it ='s 12:30  in the conversion field I have it set to double and the formula is : (100 * substring-before(OperationalTime, ":") + (substring-after(OperationalTime, ":") / 60) * 100) / 100  All I am getting is NaN in the field

     

    I also tried concat(substring-before(OperationalTime, ":"), ".", round(100 * (substring-after(OperationalTime, ":")) / 60)) and I get 12.NaN 

     When I just run substring-after(OperationalTime, ":") it returns 30:00 instead of 30  

  • 01-10-2014 09:41 AM In reply to

    Re: Converting time to Decimal

     So it sounds like the round(100 * (substring-after(OperationalTime, ":")) / 60) part has an issue of some sort. Are you sure that the portion of the value after the : is just a number and nothing else? (No AM/PM, for instance)?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-10-2014 10:59 AM In reply to

    Re: Converting time to Decimal

     Yes the field has a 12:30 in it

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