Struts中float的科学记数法

   <!-- Update Begin 20070115 GhostWolf -->
   <!-- 下次在设计时.把float型用String来代替,或者用BigDecimal来代替,这样就不会出现精度的问题了 -->
   <!--  -->
   <!--下面是为了解决页面中的科学记数法问题--> 
   <!--定义一个临时变量来保存从数据库中取得的值-->
   <bean:define id="tempFloat" name="listModel" property="applySum"/>
   <%
    //处理精度
    DecimalFormat myformat = new DecimalFormat("#");//使用系统默认的格式
    String strTemp = myformat.format(tempFloat);
   %>
            <td nowrap="nowrap" align="left"><bean:write name="listModel" property="applyDate"/></td>
            <!--<td nowrap="nowrap" align="left"><bean:write name="listModel" property="applySum"/></td>-->
   <!-- 此处 输出-->
   <td nowrap="nowrap" align="left"><%= strTemp%></td>
   <!--Update End -->

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章