Here you can find the source of formatNoDecimalPoint(double amt)
public static String formatNoDecimalPoint(double amt)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; public class Main { public static String formatNoDecimalPoint(double amt) { StringBuffer ret = new StringBuffer(); String tmp = ""; try {//from w w w .java 2s . co m tmp = new Long(new BigDecimal(amt).longValue()).toString(); } catch (NumberFormatException e) { return ""; } int index = tmp.indexOf("."); if (index == -1) { ret.append(tmp); } else { tmp = tmp.substring(0, index); ret.append(tmp); } return ret.toString(); } }