相关疑难解决方法(0)

向上或向下绕红宝石漂浮到最接近的0.05

我得到的数字就像

2.36363636363636
4.567563
1.234566465448465
10.5857447736
Run Code Online (Sandbox Code Playgroud)

我如何让Ruby将这些数字向上(或向下)舍入到最接近的0.05?

ruby floating-point rounding

25
推荐指数
6
解决办法
3万
查看次数

标签 统计

floating-point ×1

rounding ×1

ruby ×1