Rounding a double to 5 decimal places in Java ME

前端 未结 8 473
旧时难觅i
旧时难觅i 2020-12-10 05:18

How do I round a double to 5 decimal places, without using DecimalFormat?

8条回答
  •  隐瞒了意图╮
    2020-12-10 05:56

    If you are okay with external libraries, you can have a look at microfloat, specifically MicroDouble.toString(double d, int length).

提交回复
热议问题