0
我遇到問題。我用echo函數打印一個值不打印結果,但用var_dump返回值。當值低於1時,Float返回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
不起作用。回聲函數繼續沒有返回。 –