diff options
Diffstat (limited to '.zshrc-linux-desktop')
-rw-r--r-- | .zshrc-linux-desktop | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/.zshrc-linux-desktop b/.zshrc-linux-desktop index 28e251d..f92845b 100644 --- a/.zshrc-linux-desktop +++ b/.zshrc-linux-desktop @@ -43,8 +43,8 @@ mpd-filetypes() { if [[ ${counts[$i]} -eq 0 ]]; then percentages[$i]=0 else - # dunno how to make zsh math float without appending a . to integer numbers - percentages[$i]=$(calc -p "${counts[$i]} * 100 / $total" | tr -d '~' | cut -c -4) + percentages[$i]=$(calc -p "a=${counts[$i]} * 100 / $total; round(a, 4-digits(a), 16)"\ + | tr -d '~') fi # get widths for padding. @@ -70,7 +70,7 @@ mpd-filetypes() { done # print total - linelen=$(( $twidth + $cwidth + 9 )) + linelen=$(( $twidth + $cwidth + 10 )) for (( i=0; i < $linelen; i++ )); do echo -n "=" done |