menty   menty1
50.00    30.00
页面   50.00-30.00=20我想要的是这样的 50.00-30.00=20.00    为什么 .00在页面会没了呢@请各位帮助

解决方案 »

  1.   

    $a = 50.00-30.00;
    echo number_format($a,2);
      

  2.   


    <?php
    $money1 = 1168.75;
    $money2 = 1154.35;
    $money = $money1 + $money2;
    echo $money.'  ';
    // echo $money will output "123.1";
    $formatted = sprintf("%01.2f", $money);
    echo $formatted;
    // echo $formatted will output "123.10"
    ?> 
      

  3.   

    SELECT TRUNCATE( menty  - menty1 , 2 ) 
    FROM tablename