diff options
| author | Your Name <you@example.com> | 2021-11-02 09:57:31 +0000 |
|---|---|---|
| committer | Your Name <you@example.com> | 2021-11-02 09:57:31 +0000 |
| commit | 747bddd93a82c6c73a0a171c4fbfe4ef5ba93e91 (patch) | |
| tree | e7c4f7ab65e50d976043054dc2dee0acc839e419 /modules/daypercentage | |
| parent | c00842f1a2745f45d92653df0f08e4bd9ee8050f (diff) | |
Fixed bug with the daypercentage module
Bug occured when the hour was single digit, so we now remove preceding
0s
Diffstat (limited to 'modules/daypercentage')
| -rwxr-xr-x | modules/daypercentage | 2 |
1 files changed, 1 insertions, 1 deletions
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')%" } |
