Here you can find the source of round(final double value)
public static String round(final double value)
//package com.java2s; // ProjectForge is dual-licensed. import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; public class Main { /**/* w ww . j a v a 2 s . c o m*/ * yyyy-MM-dd HH:mm:ss.S in UTC. Thread safe usage: FOR_TESTCASE_OUTPUT_FORMATTER.get().format(date) */ private static final ThreadLocal<DecimalFormat> FORMAT_PRECISION_2 = new ThreadLocal<DecimalFormat>() { @Override protected DecimalFormat initialValue() { final DecimalFormatSymbols symbols = new DecimalFormatSymbols(); symbols.setDecimalSeparator('.'); return new DecimalFormat("###.##", symbols); } }; public static String round(final double value) { return FORMAT_PRECISION_2.get().format(value); } }