1

これは70.479のような結果を示しています

そして、私はそのような結果が欲しい 70.500

どうすればこれを行うことができますか この問題を解決するのを手伝ってください ありがとう

<?php //Starting of php 
    if(isset($_POST['submit']))//if the submit button has pressed
    {
    $first = $_POST['first']; //Getting Value of first integer from add.html
    $sec = $_POST['sec']; //Getting Value of Second integer from add.html
    $res = $first * $sec *75 /365 /30; //Adding the two values and placing the added result to 'res' variable
    echo 'Added Result:';
    echo "<br>Rounded value of the number = ".round($res,3); 

    }
    //Ending of php
    ?>
4

2 に答える 2

5

これを試して、

<?php 
   echo number_format((round(70.479, 1)),3);
?>

これはあなたが結果に望むものです

于 2013-11-13T05:04:18.153 に答える