You are viewing a single comment's thread. Return to all comments →
I ended up having to do
read X result=$(echo "scale=4; $X" | bc) printf "%.3f\n" $result
but I think I should have had the correct answer with just scale=3 and echoing $result without using printf. I wonder why?
Seems like cookies are disabled on this browser, please enable them to open this website
Arithmetic Operations
You are viewing a single comment's thread. Return to all comments →
I ended up having to do
but I think I should have had the correct answer with just scale=3 and echoing $result without using printf. I wonder why?