From 747bddd93a82c6c73a0a171c4fbfe4ef5ba93e91 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 2 Nov 2021 09:57:31 +0000 Subject: Fixed bug with the daypercentage module Bug occured when the hour was single digit, so we now remove preceding 0s --- modules/daypercentage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/daypercentage') diff --git a/modules/daypercentage b/modules/daypercentage index 0b7b426..5a2316f 100755 --- a/modules/daypercentage +++ b/modules/daypercentage @@ -6,7 +6,7 @@ PREFIX=' ' get_daypercentage() { - MINUTES="$[$(date +%R | cut -d ':' -f1) * 60 + $(date +%R | cut -d ':' -f2) ]" + MINUTES="$[$(date +%R | cut -d ':' -f1 | sed 's/^0*//') * 60 + $(date +%R | cut -d ':' -f2) ]" echo "$PREFIX$(echo $[ $MINUTES * 100 / 1440 ] | sed 's/\..*//g')%" } -- cgit v1.2.3