More format fixing
This commit is contained in:
parent
80eaa5ee9a
commit
5f95ba53fa
4
avail.sh
4
avail.sh
|
@ -65,7 +65,7 @@ if [[ $mode == "s" ]]; then
|
|||
diagram="${diagram}[server]\n"
|
||||
eq="${eq} * 100"
|
||||
answer=$(echo "scale=9; $eq" | bc)
|
||||
answershort=$(echo "$answer" | sed 's/\(\.[^0]\+\)0\+/\1/')
|
||||
answershort=$(echo "$answer" | sed '/\./ s/\.\{0,1\}0\{1,\}$//')
|
||||
if [[ $answershort == 99.* ]]; then
|
||||
nines=$(echo $answershort | tr -d -C 9 | wc -c | tr -d ' ')
|
||||
[[ $nines -eq 1 ]] && ess="" || ess="s"
|
||||
|
@ -186,7 +186,7 @@ elif [[ $mode == "p" ]]; then
|
|||
|
||||
eq="(1 - (1 - (${sysuptime}/100))^${nsites})*100"
|
||||
answer=$(echo "scale=15; $eq" | bc)
|
||||
answershort=$(echo "$answer" | sed 's/\(\.[^0]\+\)0\+/\1/')
|
||||
answershort=$(echo "$answer" | sed '/\./ s/\.\{0,1\}0\{1,\}$//')
|
||||
if [[ $answershort == 99.* ]]; then
|
||||
nines=$(echo $answershort | tr -d -C 9 | wc -c | tr -d ' ')
|
||||
[[ $nines -eq 1 ]] && ess="" || ess="s"
|
||||
|
|
Loading…
Reference in New Issue