0
<h2>Expected Pay <i>Between CutOff Period</i>:
<?php $Query = $Database->prepare("SELECT `Hours`,`BaseRate` FROM `hours`");
$Query->execute();
$Query->bind_result($HoursWorked, $Rate);
$Hours_Arr = array();
while ($Query->fetch()){
$Hours_Arr[] = $HoursWorked;
}
$Query->close();
echo round(count($Hours_Arr)*$Rate);
?>
</h2>
<h1>list Of Worked Hours</h1>
<?php
$Query = $Database->prepare("SELECT `DateWorked`,`StartTime`,`EndTime` FROM `hours`");
$Query->execute();
$Query->bind_result($DateWorked,$Started,$Finished);
while ($Query->fetch()){
echo "Date Worked: ".$DateWorked." Started At: ".$Started." Finished At: ".$Finished."<br>";
}
$Query->close();
?>
與上面的代碼...我有一個問題:這是工資回聲問題:
14.94000005722
:哪些輸出
echo count($Hours_Arr)*$Rate;
不是有效的薪酬點。我想這是一個實際的數字格式,但我不知道如何得到這個整數是:
£00.00
使用['sprinf() '](http://php.net/sprintf) – BlitZ
或[FormatCurrency](http://php.net/manual/en/numberformatter.formatcurrency.php) – Orangepill
@Orangepill t他可能應該真的更好';)' – BlitZ