added word print for times < 1
This commit is contained in:
parent
1390c12a5d
commit
9762081d9d
@ -9,6 +9,7 @@
|
|||||||
function smarty_modifier_seconds_to_words($seconds) {
|
function smarty_modifier_seconds_to_words($seconds) {
|
||||||
if ($seconds < 0) throw new Exception("Can't do negative numbers!");
|
if ($seconds < 0) throw new Exception("Can't do negative numbers!");
|
||||||
if ($seconds == 0) return "zero seconds";
|
if ($seconds == 0) return "zero seconds";
|
||||||
|
if ($seconds < 1) return "less than a second";
|
||||||
|
|
||||||
$hours = intval($seconds/pow(60,2));
|
$hours = intval($seconds/pow(60,2));
|
||||||
$minutes = intval($seconds/60)%60;
|
$minutes = intval($seconds/60)%60;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user