I am trying to print result of an expression to 3 decimal places using the below code. it always prints like 5.000 instead of like 5.343. is there something wrong .
number=$((5+50*3/20 + (19*2)/7))
printf "%.3f \n" $number
I am trying to print result of an expression to 3 decimal places using the below code. it always prints like 5.000 instead of like 5.343. is there something wrong .
number=$((5+50*3/20 + (19*2)/7))
printf "%.3f \n" $number