Use bc instead of expr for decimal calculations

This commit is contained in:
Michael De Roover 2020-07-14 23:46:15 +02:00
parent e8e8c96388
commit 7660fe11b7
Signed by: vim
GPG Key ID: 075496E232CE04CB
1 changed files with 1 additions and 1 deletions

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