Make getpct a little bit cleaner
This commit is contained in:
parent
082f7bf39f
commit
ebcf852e1e
8
cv
8
cv
|
@ -1,5 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
w=10
|
||||
|
||||
ex(){
|
||||
echo -e "> ${*}"
|
||||
$@
|
||||
|
@ -7,7 +9,7 @@ ex(){
|
|||
[ -z $date ] && date=$(date +"%Y-%m-%d")
|
||||
[ -z $ydate ] && ydate=$(date -d yesterday +"%Y-%m-%d")
|
||||
title(){
|
||||
w=36
|
||||
local w=36
|
||||
printf "║ %-${w}s ║\n" "${*}"
|
||||
}
|
||||
|
||||
|
@ -27,9 +29,6 @@ get(){
|
|||
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(){
|
||||
|
@ -42,7 +41,6 @@ yget(){
|
|||
fi
|
||||
}
|
||||
out(){
|
||||
w=10
|
||||
printf "║ %-${w}s ║ %${w}s ║ %-${w}s ║\n" "$1:" "$(get $2)" "+ $(echo "scale = 2; $(get $2) - $(yget $2)" | bc)"
|
||||
}
|
||||
frame(){
|
||||
|
|
Reference in New Issue