Hi,
I am working on a problem where I have to format a number with two decimalplaces. Here is an 3example of how I am trying to do this:
NumberFormat formatter = new DecimalFormat("#.##");
String s = formatter.format(item.getPrice());
double testPrice = Double.parseDouble(s);
System.out.println(""+testPrice );
the problem is that when there are no decimal places in the price, the formatter only ads one zero whereas I need two decimal places like .00 to meet the busiiness requirement.
Thanks for your help.
[ December 11, 2006: Message edited by: Stewart Johnson ]