Here you can find the source of formatDecimal(double value)
public static String formatDecimal(double value)
//package com.java2s; /*/*from w ww . j ava2 s. c o m*/ * This software copyright by various authors including the RPTools.net * development team, and licensed under the LGPL Version 3 or, at your option, * any later version. * * Portions of this software were originally covered under the Apache Software * License, Version 1.1 or Version 2.0. * * See the file LICENSE elsewhere in this distribution for license details. */ import java.text.NumberFormat; public class Main { private static NumberFormat nf = NumberFormat.getNumberInstance(); public static String formatDecimal(double value) { String result1; result1 = nf.format(value); // On a separate line to allow for breakpoints return result1; } }