From 6b294a5d90e3aa985b219346aecdc5ab81ecad23 Mon Sep 17 00:00:00 2001 From: WovenCoast Date: Fri, 9 Sep 2022 10:46:54 +0500 Subject: [PATCH] Update 'prayertime.sh' --- prayertime.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/prayertime.sh b/prayertime.sh index dcb09d8..d8f2088 100644 --- a/prayertime.sh +++ b/prayertime.sh @@ -12,11 +12,15 @@ function convertPTToESecTomorrow() { } function convertPTToHuman() { # echo $1 - if (( $(( $1 / 60 )) > 9 )) ; then - echo "$(( $1 / 60 )):$(( $1 % 60 ))" - else - echo "0$(( $1 / 60 )):$(( $1 % 60 ))" + HOUR="$(( $1 / 60 ))" + if (( $(( $1 / 60 )) < 10 )) ; then + HOUR="0$(( $1 / 60 ))" fi + MINUTE="$(( $1 % 60 ))" + if (( $(( $1 % 60 )) < 10 )) ; then + MINUTE="0$(( $1 % 60 ))" + fi + echo "$HOUR:$MINUTE" # echo "$(( $1 / 60 )):$(( $1 % 60 ))" }