65 + 10 = 75
75 x 15 x 686 = 771750
771750 / 365 / 30 = 70.479这是正确答案
这个代码显示答案错误
这是此代码74.400的错误答案
我该如何解决它请帮助我谢谢
$res = 65+10*15*686/365/30; //Adding the two values and placing the added result to 'res' variable
<?php //Starting of php
if(isset($_POST['submit']))//if the submit button has pressed
{
$days = $_POST['days']; //Getting Value of first integer from add.html
$yeardays1 = $_POST['yeardays1']; //Getting Value of Second integer from add.html
$yeardays = $_POST['yeardays1']; //Getting Value of Second integer from add.html
$basicsalary = $_POST['basicsalary']; //Getting Value of Second integer from add.html
$allowsalary = $_POST['allowsalary']; //Getting Value of Second integer from add.html
$res = (($basicsalary + $allowsalary)* $days * $yeardays1) / $yeardays /$monthdays;
echo number_format((round($res, 1)),3);
}
//Ending of php
?>