Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
小数点第1位の半分に切り下げたいのですが。
したがって、1.45の場合は1に丸められます。1.55の場合は1.5に切り下げられます。それは理にかなっていますか?
Math.floor(x*2)/2
これで十分です。