One, bc lacks 0 problem
bc is a powerful and commonly used calculation tool,
but when doing division operations, if the result value is less than 1, the 0 before the decimal is missing:
echo "scale=2;2/3"|bc
.66
//注意这里必须带 scale ,否则输出为 0 。
Two, simple complement 0 method
echo $(printf "%.2f" `echo "scale=2;1/3"|bc`)
0.66