请教数字格式
我想要数字只保留2位小数,用下面的代码<%@ page import="java.text.*" %>
DecimalFormat df=new DecimalFormat("##.00");
System.out.println(df.format(1234.5622));
但是为什么提示错误呢,下面是错误提示
org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
D:\tomcat\work\localhost_8080%2Fssyji\_0002fCurve_0002ejspCurve_jsp_10.java:213: Invalid declaration.
java.text.DecimalFormat df = new java.text.DecimalFormat("##.00");
^
D:\tomcat\work\localhost_8080%2Fssyji\_0002fCurve_0002ejspCurve_jsp_10.java:215: Undefined variable or class name: df
System.out.println(df.format(1234.5622));
^
望高手指教!!
[此贴子已经被作者于2006-2-22 11:34:45编辑过]