TimeAsDecimal ( xTime )
Convert time into decimal
Average rating: 4.2 (26 votes) Log in to vote
Tony Tanevski - Show more from this author
Hi-Voltage http://www.hi-voltage.com.au |
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
Convert hours into decimal
Enjoy,
Tony Tanevski
Hi-Voltage, Melbourne Australia
Comments
Bernard Moreau, Borchtlombeek, Belgium. Oct 26, 2015 |
||
Hour(xTime) + Minute(xTime) / 60 should work too, isn't it ? |
||
comment, VR Oct 28, 2015 |
||
Or simply: Time / 3600 |
||
Tony Tanevski, Melbourne Oct 28, 2015 |
||
Time / 3600 does work, but needs to be rounded as it can return multiple decimal places. i.e. 1:24:53s returns 1.4147222222222222 Whereas my function disregards the seconds completely - it just depends on whether you want to include seconds or not. |
||
comment, VR Oct 28, 2015 |
||
Well, using your calculation, 00:01:00 will return 0.0166666666666667. Ignoring the seconds has nothing with this - all it accomplishes is making the calculation more complicated and the result less precise. | ||
Tony Tanevski, Melbourne Oct 28, 2015 |
||
Yes you are right :) | ||
Thomas Hellwig, Germany Dec 26, 2015 |
||
So why don't you delete the wrong CF "round(xTime / 3600, 2)"? | ||
Tony Tanevski, Melbourne, Australia Dec 26, 2015 |
||
No need to delete the custom function as it has been corrected. | ||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.