[ 1826511 ] DecimalFormat Static to #.## this should take context

http://sourceforge.net/tracker/index.php?func=detail&aid=1826511&group_id=176962&atid=928568
This commit is contained in:
vpj-cd 2007-11-06 03:16:28 +00:00
parent 9657819e1d
commit 4dd66c3127
4 changed files with 17 additions and 6 deletions

View File

@ -37,6 +37,7 @@ import java.util.Iterator;
import java.util.Properties;
import java.util.TreeMap;
import org.compiere.util.DisplayType;
import org.jfree.chart.axis.DateAxis;
import org.jfree.chart.labels.StandardPieSectionLabelGenerator;
import org.jfree.chart.plot.PiePlot;
@ -292,7 +293,8 @@ public class CustomPOSReportManager
ArrayList<Object[]> reportData = new ArrayList<Object[]>();
//copying data from tmpData to reportData
NumberFormat formatter = new DecimalFormat("###,###,##0.00");
//NumberFormat formatter = new DecimalFormat("###,###,##0.00");
NumberFormat formatter = DisplayType.getNumberFormat(DisplayType.CostPrice);
Iterator<Object[]> iter = tmpData.iterator();
@ -392,7 +394,8 @@ public class CustomPOSReportManager
boolean isTaxDue = (account_id == Constants.TAX_DUE.intValue() );
boolean isTaxCredit = (account_id == Constants.TAX_CREDIT.intValue() );
NumberFormat formatter = new DecimalFormat("###,###,##0.00");
//NumberFormat formatter = new DecimalFormat("###,###,##0.00");
NumberFormat formatter = DisplayType.getNumberFormat(DisplayType.CostPrice);
String sql = SalesAnalysisReportManager.getTabularDataSetSQL(ctx,account_id,fromDate,toDate,salesGroup);
ArrayList<Object[]> tmpData = ReportManager.getReportData(ctx,sql,true);

View File

@ -39,6 +39,7 @@ import org.compiere.print.ReportEngine;
import org.compiere.process.DocAction;
import org.compiere.process.DocumentEngine;
import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.posterita.beans.CreditCheckBean;
@ -185,7 +186,8 @@ public class OrderManager
public static double round(double value)
{
DecimalFormat f = new DecimalFormat("#.##");
DecimalFormat f = DisplayType.getNumberFormat(DisplayType.Number);
return Double.parseDouble(f.format(value));
}

View File

@ -69,6 +69,7 @@ import org.compiere.model.MUser;
import org.compiere.model.MWarehouse;
import org.compiere.process.DocumentEngine;
import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.TimeUtil;
import org.compiere.util.Trx;
@ -987,7 +988,8 @@ public class POSManager
Object[] headers = new Object[]{"POS Name","Cash Total","Card Total","Cheque Total","Amount"};
reportData.add(headers);
NumberFormat formatter = new DecimalFormat("###,###,##0.00");
//NumberFormat formatter = new DecimalFormat("###,###,##0.00");
DecimalFormat f = DisplayType.getNumberFormat(DisplayType.CostPrice);
Object[] data = null;
String grandTotal = null;

View File

@ -51,6 +51,7 @@ import org.compiere.model.MTransaction;
import org.compiere.model.MUser;
import org.compiere.model.MWarehouse;
import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.utils.DBUtils;
import org.posterita.Constants;
@ -1009,7 +1010,8 @@ public class POSReportManager {
String customerAddress = null;
String documentNo = null;
String currency = "Rs ";
NumberFormat formatter = new DecimalFormat("###,###,##0.00");
//NumberFormat formatter = new DecimalFormat("###,###,##0.00");
NumberFormat formatter = DisplayType.getNumberFormat(DisplayType.CostPrice);
currency = POSTerminalManager.getPOSDefaultSellCurrency(ctx)
.getCurSymbol()
@ -2264,7 +2266,9 @@ public class POSReportManager {
// final float THIN_BORDER = 1.0f;
String currency = "Rs ";
NumberFormat formatter = new DecimalFormat("###,###,##0.00");
//NumberFormat formatter = new DecimalFormat("###,###,##0.00");
NumberFormat formatter = DisplayType.getNumberFormat(DisplayType.CostPrice);
PdfPCell cell = null;
// step 1: creation of a document-object