<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Convert time to decimal time</title><link>https://www.infopathdev.com:443/forums/thread/95108.aspx</link><pubDate>Thu, 09 Jan 2014 16:30:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:95108</guid><dc:creator>recono1</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/95108.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=95108</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I am trying to do this in InfoPath 2013 and it is not working I have a field with a time OperationalTime and it =&amp;#39;s 12:30&amp;nbsp; in the conversion field I have it set to double and the formula is : (100 * substring-before(OperationalTime, &amp;quot;:&amp;quot;) + (substring-after(OperationalTime, &amp;quot;:&amp;quot;) / 60) * 100) / 100&amp;nbsp; All I am getting is NaN in the field&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I also tried concat(substring-before(OperationalTime, &amp;quot;:&amp;quot;), &amp;quot;.&amp;quot;, round(100 * (substring-after(OperationalTime, &amp;quot;:&amp;quot;)) / 60)) and&amp;nbsp;I get 12.NaN&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;When&amp;nbsp;I just run substring-after(OperationalTime, &amp;quot;:&amp;quot;) it returns 30:00 instead of 30&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Convert time to decimal time</title><link>https://www.infopathdev.com:443/forums/thread/85271.aspx</link><pubDate>Wed, 12 Dec 2012 18:52:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:85271</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/85271.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=85271</wfw:commentRss><description>Good catch and thank you for pointing it out.&amp;nbsp; I&amp;#39;ll modify my formula accordingly.</description></item><item><title>Re: Convert time to decimal time</title><link>https://www.infopathdev.com:443/forums/thread/85270.aspx</link><pubDate>Wed, 12 Dec 2012 18:50:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:85270</guid><dc:creator>workin'stiff</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/85270.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=85270</wfw:commentRss><description>&lt;p&gt;Thanks for the very quick response. In working with the formula, I needed&amp;nbsp;modify&amp;nbsp;your suggestion&amp;nbsp;to get the rounding and decimal placement correct in the final value.&lt;/p&gt;
&lt;p&gt;(100 * substring-before(IncomingTime, &amp;quot;:&amp;quot;) + (substring-after(IncomingTime, &amp;quot;:&amp;quot;) / 60) &lt;strong&gt;&lt;em&gt;* 100&lt;/em&gt;&lt;/strong&gt;) / 100&lt;/p&gt;
&lt;p&gt;But things are working swimmingly. Thanks Jimmy.&lt;/p&gt;</description></item><item><title>Re: Convert time to decimal time</title><link>https://www.infopathdev.com:443/forums/thread/85268.aspx</link><pubDate>Wed, 12 Dec 2012 17:16:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:85268</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/85268.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=85268</wfw:commentRss><description>&lt;p&gt;Actually, it&amp;#39;s doing this:&lt;/p&gt;&lt;p&gt;concat(1, &amp;quot;.&amp;quot;, round(100 * 05 / 60))&lt;/p&gt;&lt;p&gt;concat(1, &amp;quot;.&amp;quot;, round(8.33333))&lt;/p&gt;&lt;p&gt;concat(1, &amp;quot;.&amp;quot;, 8)&lt;/p&gt;&lt;p&gt;1.8&lt;/p&gt;&lt;p&gt;And I must blame my own naïveté for posting that faulty formula 3 years ago.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I&amp;#39;d suggest this formula:&lt;/p&gt;&lt;p&gt;round(100 * substring-before(IncomingTime, &amp;quot;:&amp;quot;) + 100 * (substring-after(IncomingTime, &amp;quot;:&amp;quot;) div 60)) div 100&lt;/p&gt;&lt;p&gt;And I&amp;#39;ll correct my post above.&lt;/p&gt;</description></item><item><title>Re: Convert time to decimal time</title><link>https://www.infopathdev.com:443/forums/thread/85267.aspx</link><pubDate>Wed, 12 Dec 2012 16:48:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:85267</guid><dc:creator>workin'stiff</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/85267.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=85267</wfw:commentRss><description>&lt;p&gt;Sorry about reopening a fairly old thread. I&amp;#39;m having an issue with converting times involving 5 mintue intervals. For instance, when I convert 1:05 (h:mm), it is computed as 1.8. The code formula I&amp;#39;m using is: concat(substring-before(IncomingTime, &amp;quot;:&amp;quot;), &amp;quot;.&amp;quot;, round(100 * substring-after(IncomingTime, &amp;quot;:&amp;quot;) / 60))&lt;/p&gt;
&lt;p&gt;It appears that formula is treating 05 as 50, hence the .8 of an hour. Does anyone have any suggestions on how to treat it as 5 minutes in lieu of 50?&lt;/p&gt;</description></item><item><title>Re: Convert time to decimal time</title><link>https://www.infopathdev.com:443/forums/thread/51910.aspx</link><pubDate>Thu, 18 Feb 2010 19:51:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:51910</guid><dc:creator>rjanssen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/51910.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=51910</wfw:commentRss><description>&lt;p&gt;Hey! Have the same problem, i want to convert the time into decimal but i cannot get this code to work. I don&amp;#39;t understand what i am doing wrong.&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s say i have two fields &lt;strong&gt;field1&lt;/strong&gt; is showing the normal time 2:33&amp;nbsp;how do i get&amp;nbsp;&lt;strong&gt;field2&amp;nbsp;&lt;/strong&gt;to convert the time to&amp;nbsp;2.55?&lt;br /&gt;I tried the code Jimmy was mentioning but i can not get it to work.&lt;/p&gt;
&lt;p&gt;Any help will be appreciated!&lt;/p&gt;</description></item><item><title>Re: Convert time to decimal time</title><link>https://www.infopathdev.com:443/forums/thread/50808.aspx</link><pubDate>Wed, 20 Jan 2010 21:21:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50808</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50808.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=50808</wfw:commentRss><description>&lt;p&gt;I love &lt;a href="http://www.flos-freeware.ch/zip/notepad2.zip"&gt;Notepad2&lt;/a&gt; for things like this (note, link is to the .zip file for the download)&amp;nbsp;-- it has parenthetical matching -- highlights your parentheses when you select them, so that you can see the pairs easily. &lt;/p&gt;</description></item><item><title>Re: Convert time to decimal time</title><link>https://www.infopathdev.com:443/forums/thread/50794.aspx</link><pubDate>Wed, 20 Jan 2010 18:03:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50794</guid><dc:creator>samonenate</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50794.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=50794</wfw:commentRss><description>&lt;p&gt;It works!!!&amp;nbsp; You have no idea how appreciated this is - thanks a billion times!!!!!&lt;/p&gt;</description></item><item><title>Re: Convert time to decimal time</title><link>https://www.infopathdev.com:443/forums/thread/50792.aspx</link><pubDate>Wed, 20 Jan 2010 17:34:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50792</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50792.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=50792</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Looks like you&amp;#39;re missing an end-parenthesis.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Convert time to decimal time</title><link>https://www.infopathdev.com:443/forums/thread/50790.aspx</link><pubDate>Wed, 20 Jan 2010 17:14:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50790</guid><dc:creator>samonenate</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50790.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=50790</wfw:commentRss><description>&lt;p&gt;&lt;br /&gt;As you can tell working with formulas is not my strong suit...&amp;nbsp; I tried the following formula and this is the error message I get:&lt;/p&gt;
&lt;p&gt;Formula:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;concat(substring-before(NCRHours, &amp;quot;:&amp;quot;), &amp;quot;.&amp;quot;, round(100 * substring-after(NCRHours, &amp;quot;:&amp;quot;) / 60)&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Error Message:&lt;/p&gt;
&lt;p&gt;Expected value type: ,&lt;/p&gt;
&lt;p&gt;Actual value: end-of-string&lt;br /&gt;concat(substring-before(NCRHours, &amp;quot;:&amp;quot;), &amp;quot;.&amp;quot;, round(100 * substring-after(NCRHours, &amp;quot;:&amp;quot;) div 60)&amp;lt;--&lt;/p&gt;</description></item><item><title>Re: Convert time to decimal time</title><link>https://www.infopathdev.com:443/forums/thread/50706.aspx</link><pubDate>Mon, 18 Jan 2010 22:27:23 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50706</guid><dc:creator>ricomarcelo</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50706.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=50706</wfw:commentRss><description>&lt;p&gt;try using the round() function in the formula:&lt;/p&gt;
&lt;p&gt;round(100*substring-after(&lt;u&gt;&lt;b&gt;field&lt;/b&gt;&lt;/u&gt;, &amp;quot;:&amp;quot;) div 60)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;or use ToString(&amp;quot;#.##&amp;quot;) in the C# code:&lt;/p&gt;&lt;p&gt;(int.Parse(Temp[0]) + (double.Parse(Temp[1]) / 60)).ToString(&amp;quot;#.##&amp;quot;) &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Convert time to decimal time</title><link>https://www.infopathdev.com:443/forums/thread/50704.aspx</link><pubDate>Mon, 18 Jan 2010 19:59:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50704</guid><dc:creator>samonenate</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50704.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=50704</wfw:commentRss><description>&lt;font face="Times New Roman" size="3"&gt;&lt;/font&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;span style="FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;"&gt;The formula is working, but for some calculations it is adding 2 decimal points for calculations that go to infinity.&amp;nbsp; I tried changing the field with&amp;nbsp;the formula&amp;nbsp;from Text to Decimal,&amp;nbsp;but I get validation errors.&amp;nbsp; Here is an example of what is occurring:&lt;/span&gt; 
&lt;p&gt;&lt;/font&gt;&amp;nbsp;1:59 gets converted to 1.98.33333333333333&lt;/p&gt;
&lt;p&gt;12:11 gets converted to 12.18.33333333333332&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Convert time to decimal time</title><link>https://www.infopathdev.com:443/forums/thread/50625.aspx</link><pubDate>Fri, 15 Jan 2010 03:34:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50625</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50625.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=50625</wfw:commentRss><description>&lt;p&gt;Or you can just use this formula: &lt;br /&gt;&lt;/p&gt;

&lt;p style="text-decoration:line-through;"&gt;concat(substring-before(&lt;b&gt;&lt;u&gt;field&lt;/u&gt;&lt;/b&gt;, &amp;quot;:&amp;quot;), &amp;quot;.&amp;quot;, 100 * substring-after(&lt;u&gt;&lt;b&gt;field&lt;/b&gt;&lt;/u&gt;, &amp;quot;:&amp;quot;) div 60)&lt;/p&gt;

&lt;p&gt;round(100 * substring-before(&lt;strong&gt;&lt;u&gt;field&lt;/u&gt;&lt;/strong&gt;, &amp;quot;:&amp;quot;) + 100 * (substring-after(&lt;strong&gt;&lt;u&gt;field&lt;/u&gt;&lt;/strong&gt;, &amp;quot;:&amp;quot;) div 60)) div 100&lt;/p&gt;</description></item><item><title>Re: Convert time to decimal time</title><link>https://www.infopathdev.com:443/forums/thread/50621.aspx</link><pubDate>Thu, 14 Jan 2010 22:08:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50621</guid><dc:creator>ricomarcelo</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50621.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=50621</wfw:commentRss><description>&lt;p&gt;try this code:&lt;/p&gt;
&lt;p&gt;public void CTRL2_5_Clicked(object sender, ClickedEventArgs e)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;XPathNavigator root = MainDataSource.CreateNavigator();&lt;br /&gt;&amp;nbsp;string Time = root.SelectSingleNode(&amp;quot;/my:myFields/my:field1&amp;quot;, NamespaceManager).Value;&lt;br /&gt;&amp;nbsp;string[] Temp = Time.Split(&amp;#39;:&amp;#39;);&lt;br /&gt;&amp;nbsp;root.SelectSingleNode(&amp;quot;/my:myFields/my:field2&amp;quot;, NamespaceManager).SetValue((int.Parse(Temp[0])+(double.Parse(Temp[1])/60)).ToString());&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;HTH&lt;/p&gt;</description></item><item><title>Convert time to decimal time</title><link>https://www.infopathdev.com:443/forums/thread/50617.aspx</link><pubDate>Thu, 14 Jan 2010 20:00:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50617</guid><dc:creator>samonenate</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50617.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=50617</wfw:commentRss><description>&lt;p&gt;I need&amp;nbsp;help with&amp;nbsp;formula or code to convert time&amp;nbsp;entered in one field to decimal time in another field.&amp;nbsp; For example, 2:33 would get converted to 2.55.&amp;nbsp; Any help would be appreciated, thanks.&lt;/p&gt;</description></item></channel></rss>