CEILING fnc in Excel in Javascript?

47 views Asked by At

CEILING in Excel =CEILING(E2,6)/60 for calculating legal billable hours in 6 min increments from minutes (1 min = 0.1, 5 min = 0.1, 7 min = 0.2 etc) when transposed to JS with the CEIL function as: var legal = Math.ceil(total_time, 6) / 6 where total_time is (date_end - date_start) / 60000 and date_end and date_start field values in ms does not work when values are for eg. 2 min --> 0.2

Inputed values do not provide CEILING in 6 min increments as in Excel, other than values such as 30 min = 0.5

1

There are 1 answers

1
DJLConsulting On

Answer: return Math.ceil(n/6.0) / 10;