提问人:DJLConsulting 提问时间:7/4/2023 最后编辑:Mayukh BhattacharyaDJLConsulting 更新时间:7/4/2023 访问量:35
Javascript 中 Excel 中的 CEILING fnc?
CEILING fnc in Excel in Javascript?
问:
Excel 中的 CEILING,用于从分钟(1 分钟 = 0.1、5 分钟 = 0.1、7 分钟 = 0.2 等)以 6 分钟为增量计算法定计费小时数,当将 CEIL 函数转换为 JS 时:当值为 例如时,以 ms 为单位不起作用。2 分钟 --> 0.2=CEILING(E2,6)/60
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
输入的值不像在 Excel 中那样以 6 分钟的增量提供 CEILING,但30 min = 0.5
答:
评论
Math.ceil
Math.ceil(n * 6) / 6