Here you can find the source of formatDecimal(BigDecimal num)
public static String formatDecimal(BigDecimal num)
//package com.java2s; /**//ww w.java2s . co m * Copyright (c) 2005, 2013, Werner Keil and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Grahame Grieve - initial API and implementation */ import java.math.BigDecimal; import java.text.NumberFormat; import java.util.Locale; public class Main { public static String formatDecimal(BigDecimal num) { return NumberFormat.getInstance(Locale.US).format(num); } }