select a.factprice-a.TotalPrice as MailCost from table a 
绑定到前台中出现以下的值:
0.00999999999999091
我想让其保留2位小数点,并四舍五入,该怎么弄?谢谢

解决方案 »

  1.   


    tryselect ROUND(a.factprice-a.TotalPrice,2) as MailCost from table a 
      

  2.   

    round(a.factprice-a.TotalPrice,2) or decimal(a.factprice-a.TotalPrice,12,2)
      

  3.   

    round();
    例:
    select round(23.567,2) as f1,round(23.564,2) as f2  from dual;
            F1         F2
    ---------- ----------
         23.57      23.56
      

  4.   

    Select round(23.565,2) from Table
    23.57
      

  5.   

    select cast('0.00999999999999091' as numeric(12,2))