0
問題があります。 echo関数で値を表示しても、結果は表示されませんが、var_dumpの戻り値があります。値が1未満の場合、Float return 0を返します。
//$issue['fields']['timeestimate'] value is 2700
echo $this->toHours($issue['fields']['timeestimate']); return nothing
var_dump($this->toHours($issue['fields']['timeestimate'])); return float(0.75)
機能は
private function toHours($seconds){
return $seconds/3600;
}
何が問題になっていますでしょうか?値が1以上の場合は、正しい値を返します。
http://php.net/manual/en/function.ceil.php試してみてください。私はそれがあなたの後ろにあると思います... – markdwhite
おそらくそれは精度の問題。大きな赤いボックスhttp://php.net/manual/en/language.types.float.php – Qirel
は読めません。 echo関数は何も返しません。 –