Calculation number to be hours and minutes
Im just wondering if you could help.... i have added in a calculation that subtract timecamps time from the overall time allocated for the project in each job/project. However it is working it out in decimals rather than time, for example 1.50 is 1hr 30mins. is there a formula i can add in to change this? Many thanks Becca

  • Hi Becca, yes, that's possible. But when you change it you can calculate further with the result, cause it changes from number to string format. If you don't need the result " 1 h 30 mins " for further calculations but only for displaying it, you can use: var subValue = overall time - timecamps time; // result: 1,5; var hNmb = parseInt(subValue, 10) // gets the integer 1 (hr); mNmb = Math.round((subValue*60)-(hNmb*60)) // is: 90-60 = 30(mins); Math.round rounds to full minutes hNmb + "hr " + mNmb + "mins" // is displayed as : 1hr 30mins Do this calculation in a new calculation fields cause your existing field has been saved in number format, but your new result is a string. The format of once saved calculation fields can't be changed. Rainer rg@delos-consulting.com
This question is closed.