日期:2014-05-16  浏览次数:20793 次

Unix expr 命令如何进行小数点计算,返回有小数点的结果
cnt_idle=23
echo "scale=2;$cnt_idle / 8" | bc -l

返回:2.87

明白了吧,scale=2意思就是小数点精确2位。