gootmundi
asked on
Using DecimalFormat
I'm attempting to use an object of the DecimalFormat class. However, I'm continually receiving the following when I attempt to compile:
"cannot resolve symbol class DecimalFormat"
for the lines where I create a new DecimalFormat object. My code is as such:
-------------------------- ---------- ---------- ---------- ----------
public class DecimalFormatDemo
{
public static void main(String[] args)
{
DecimalFormat twoDigitsPastPoint = new DecimalFormat("0.00");
DecimalFormat threeDigitsPastPoint = new DecimalFormat("00.000");
double d = 12.3456789;
System.out.println(twoDigi tsPastPoin t.format(d ));
System.out.println(threeDi gitsPastPo int.format (d));
}
}
-------------------------- ---------- ---------- ---------- ---------- -------
Any ideas what I'm doing wrong??
"cannot resolve symbol class DecimalFormat"
for the lines where I create a new DecimalFormat object. My code is as such:
--------------------------
public class DecimalFormatDemo
{
public static void main(String[] args)
{
DecimalFormat twoDigitsPastPoint = new DecimalFormat("0.00");
DecimalFormat threeDigitsPastPoint = new DecimalFormat("00.000");
double d = 12.3456789;
System.out.println(twoDigi
System.out.println(threeDi
}
}
--------------------------
Any ideas what I'm doing wrong??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Excuse me
import java.text.DecimalFormat ;