Use bc instead of expr for decimal calculations

This commit is contained in:
2020-07-14 23:46:15 +02:00
parent e8e8c96388
commit 7660fe11b7

2
cv
View File

@@ -37,7 +37,7 @@ yget(){
}
out(){
w=10
printf "║ %-${w}s ║ %${w}s ║ %-${w}s ║\n" "$1:" "$(get $2)" "+ $(expr $(get $2) - $(yget $2))"
printf "║ %-${w}s ║ %${w}s ║ %-${w}s ║\n" "$1:" "$(get $2)" "+ $(echo "scale = 2; $(get $2) - $(yget $2)" | bc)"
}
frame(){
case "$1" in