`Math.floor(Date.now() / 1000)` と `Math.round(Date.now() / 1000)` の違いが気になり出した

Reply to this note

Please Login to reply.

Discussion

自分のnostrのcreated_atにround使ってるけどfloorで切り捨てた方がいいのかな

floorで切り捨てたら900ms戻るの個人的に気持ち悪さがあるから一番近い秒数に寄せたくなるんだけど

秒ぐらいの精度であんま考えても仕方ないか

javascript - Math.round(num) vs num.toFixed(0) and browser inconsistencies - Stack Overflow

https://stackoverflow.com/questions/566564/math-roundnum-vs-num-tofixed0-and-browser-inconsistencies

Number.prototype.toFixedなんてあるんだになってる