我正在写一个代码来转换
HH:MM
即H.M
hrs 4:20
== 4.33
hrs 等价物。
为此,我想通过将 20 分钟0.33
除以 将其转换为小时60
。
但每次我得到 infdig 范围错误。
我试过使用
Number((minutes/60).toFixed(2))
-> 没有运气
Math.round((minutes/60 + Number.EPSILON) * 100) / 100
-> 仍然没有运气。
可以请任何人帮助我吗?
我正在写一个代码来转换
HH:MM
即H.M
hrs 4:20
== 4.33
hrs 等价物。
为此,我想通过将 20 分钟0.33
除以 将其转换为小时60
。
但每次我得到 infdig 范围错误。
我试过使用
Number((minutes/60).toFixed(2))
-> 没有运气
Math.round((minutes/60 + Number.EPSILON) * 100) / 100
-> 仍然没有运气。
可以请任何人帮助我吗?
There is nothing wrong with your code. An infdig scope error relates to a state change and subsequent $digest cycle in your component. See https://docs.angularjs.org/error/$rootScope/infdig