Use bc instead of expr for decimal calculations
This commit is contained in:
2
cv
2
cv
@@ -37,7 +37,7 @@ yget(){
|
|||||||
}
|
}
|
||||||
out(){
|
out(){
|
||||||
w=10
|
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(){
|
frame(){
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
Reference in New Issue
Block a user