Wrathchild
Technical User
Thanks to this board I was able to figure out how to us bc effectively and then drop off the excessive numbers since I want the format 000.00
My question is right now I'm just cutting off the numbers to the right of the 2nd decimal position, so the hundreths aren't alwasy correct due to lack of rounding. How can I incorporate rounding?
My question is right now I'm just cutting off the numbers to the right of the 2nd decimal position, so the hundreths aren't alwasy correct due to lack of rounding. How can I incorporate rounding?
Code:
PERCENT=`printf "%s\n" "scale = 5; ($COUNT5 / $COUNT * 100)" | bc`
PERCENT=${PERCENT%???}