double round = 134.23445; java.text.NumberFormat nf = new java.text.DecimalFormat("0.00"); System.out.println(nf.format(round)); if you need to round a value to three positions new java.text.DecimalFormat("0.000");
No comments:
Post a Comment