Add a rather ugly percentage counter

This commit is contained in:
Michael De Roover 2020-08-02 22:00:01 +02:00
parent eddeff6618
commit 8c9b053b44
Signed by: vim
GPG Key ID: 075496E232CE04CB
1 changed files with 7 additions and 0 deletions

7
cv
View File

@ -26,6 +26,12 @@ get(){
jq -r ".$1" < "$data/$date-$country"
fi
}
getpct(){
# FIXME: Seriously, this is ugly as fuck. Fix ASAP!
# Also don't get this out of dev, kthx
w=10
printf "║ %-${w}s ║ %${w}s ║ %-${w}s ║\n" "" "$(echo "$(bc <<< "scale = 1; $(get $1) / 10000") %")" ""
}
yget(){
date=$ydate
if [ -f "$data/$date-$country" ]
@ -63,6 +69,7 @@ result(){
out Recovered recovered
out Tests tests
out "╰> Per 1M" testsPerOneMillion
getpct testsPerOneMillion
if [ ! -f $data/$ydate-$country ] || [ $(get todayCases) == "0" ]
then
frame line