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/4 に丸めたい。たとえば、 がある場合は に3.21丸め、3.25がある場合は に3.46丸め3.50ます。そのための方法を書きたいのですが、方法がわかりません。
3.21
3.25
3.46
3.50
これを試して:(number / 0.25).round * 0.25
(number / 0.25).round * 0.25