From 1a7538265f7a2748e8864c002e75e55cb8a270ba Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 27 Jul 2018 08:27:37 +0200 Subject: lib/converter.php -> lib/helper.php --- lib/converter.php | 86 ------------------------------------------------------- lib/helper.php | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 86 deletions(-) delete mode 100644 lib/converter.php create mode 100644 lib/helper.php (limited to 'lib') diff --git a/lib/converter.php b/lib/converter.php deleted file mode 100644 index 41951c7..0000000 --- a/lib/converter.php +++ /dev/null @@ -1,86 +0,0 @@ - 1) - $result = - sprintf( - "%d days and %s", - $tmp, - $result - ); - elseif ($tmp == 1) - $result = - sprintf( - "%d day and %s", - $tmp, - $result - ); - else - $printed_conjunction = false; - $val = floor($val / 7); - if ($val == 0) - return $result; - if ($printed_conjunction) - $result = - sprintf( - ", %s", - $result - ); - else - $result = - sprintf( - " and %s", - $result - ); - if ($val>1) - $result = - sprintf( - "%d weeks%s", - $val, - $result - ); - else - $result = - sprintf( - "%d week%s", - $val, - $result - ); - return $result; -} diff --git a/lib/helper.php b/lib/helper.php new file mode 100644 index 0000000..41951c7 --- /dev/null +++ b/lib/helper.php @@ -0,0 +1,86 @@ + 1) + $result = + sprintf( + "%d days and %s", + $tmp, + $result + ); + elseif ($tmp == 1) + $result = + sprintf( + "%d day and %s", + $tmp, + $result + ); + else + $printed_conjunction = false; + $val = floor($val / 7); + if ($val == 0) + return $result; + if ($printed_conjunction) + $result = + sprintf( + ", %s", + $result + ); + else + $result = + sprintf( + " and %s", + $result + ); + if ($val>1) + $result = + sprintf( + "%d weeks%s", + $val, + $result + ); + else + $result = + sprintf( + "%d week%s", + $val, + $result + ); + return $result; +} -- cgit v1.2.3-70-g09d2