double d1 = 2.1936999999999998;
DecimalFormat df = new DecimalFormat("0.0###");
double d2 = Double.valueOf(df.format(d1)).doubleValue();
DecimalFormat df = new DecimalFormat("0.0###");
double d2 = Double.valueOf(df.format(d1)).doubleValue();
解决方案 »
- hibernate中一对多级联保存一个很大的List对象,怎么做才降低内存损耗。
- hibernate中有第4种状态么
- java mail(SSL)
- 如何将一个Integer型转换成负的大写的Short型
- 请教高手 怎样使用struts-menu制作树型菜单?
- request.setCharacterEncoding("gbk");的奇怪问题
- <html:link page="index.jsp" >index.jsp</html:link>为什么用不了
- 请问jspSmartUpload做文件下载的好处
- 无法保存jsp(Jbuilder)
- 我已经在输出前包含了<jsp:include page="2.jsp"/>,
- 一个很急的问题,请大家帮忙看看!!!必有重谢!!!
- 使用<servlet>标记时出现问题,敬请帮忙
public class Untitled1 {
public static void main(String[] args) {
DecimalFormat aa = new DecimalFormat();
aa.setMaximumFractionDigits(4);
System.out.print(aa.format(2.1936999999999998));
}
}