Bash script: specify bc output number format

In one line:

printf "%0.6f\n" $(bc -q <<< scale=6\;1/2)

Leave a Comment