当前位置:首页 » 多媒体相关

为什么ASP会这样?!!!!!!!!!!!1


19.5-0.55=1.40000004768372  
   
   
  ???????????????????//

推荐阅读

  • 微软荣登最受尊重企业榜首 IBM第五苹果第九 [详细内容]
  • 个人Blog的价值 新概念个人主页的赢利? [详细内容]
  • CX65网络设置有缺陷 [详细内容]
  • 苹果将推升级版iPod 视频版是否会发布? [详细内容]
  • 给blogger们一些建议 [详细内容]
  • x488电话号码姓名前加字母的方法 [详细内容]
  • 面对投诉苹果最终表态 iPodNano中国同步更换 [详细内容]
  • 网友回答:
    网友:lizexpert

    数据是不是从数据库中读出的,如果是这是一个常见问题  
      我一般自己编程保留小数

    网友:lizexpert

    源代码给你   java版  
      tmp   为要处理的数字  
      length   为要保留的位数  
      返回值为   结果  
       
              public   double   parsedouble(double   tmp,int   length)               //解析double值  
              {  
              try  
                      {    
                              string     res=new   string();  
                              int           index;  
       
                              res=string.valueof(tmp);  
         
                              index=res.indexof(.);  
                              res=res.substring(0,index+length);  
       
                      return     double.valueof(res).doublevalue();  
                      }  
                      catch(exception   e)  
                      {  
                      e.printstacktrace();  
                      return   -1;  
                      }  
              }

    网友:lixingyan

    在什么环境中出的问题?

    网友:xuya

     
      round(expression[,   numdecimalplaces])  
      arguments  
      expression    
      required.   numeric   expression   being   rounded.    
      numdecimalplaces    
      optional.   number   indicating   how   many   places   to   the   right   of   the   decimal   are   included   in   the   rounding.   if   omitted,   integers   are   returned   by   the   round   function.    
      remarks  
      the   following   example   uses   the   round   function   to   round   a   number   to   two   decimal   places:    
       
      dim   myvar,   pi  
      pi   =   3.14159  
      myvar   =   round(pi,   2)     myvar   contains   3.14.  
     

    网友:dsonet

    可以用formatnumber格式化表达式,或者先把参加操作的数据显式转换成需要的类型。然后再进行运算。一般这样解决因该市没有问题了。

    网友:dsonet

    刚才说的是用vbscript时的解决办法。在javascript中可以这样用numobj.tofixed([fractiondigits]),不过返回的是字符串。如果需要,再转成数字。

    .

    讨论区

    Login