Here you can find the source of toAccountantFormat(String str, int scale)
public static String toAccountantFormat(String str, int scale)
//package com.java2s; //License from project: Open Source License public class Main { public static String toAccountantFormat(String str, int scale) { if (str != null) { String temp = "#,###,###,###,##0."; for (int i = 0; i < scale; i++) { temp += "0"; }//from w ww . j a v a 2s . co m return new java.text.DecimalFormat(temp).format(Double.valueOf(str)); } else { return "0.00"; } } }