經安全檢測,此網站為安全網站,請放心前往原始網址!

Double value to round up in Java - Stack Overflow

Live @Sergey's solution but with integer division. double value = 23.8764367843; double rounded = (double) Math.round(value * 100) / 100; System.out.println(value +" rounded is "+ rounded); prints 23.8764367843 rounded is 23.88 EDIT: As Sergey points out,

stackoverflow.com

網址安全性掃描由 google 提供