round nubers to the hundredth

This commit is contained in:
ida schmidt 2023-05-30 20:03:06 -07:00
parent 9ca3fca632
commit 5d6c422e56

View file

@ -37,8 +37,8 @@ function calcratio { # this is mildly hacky
for RATIO in $(grep 'ratios' -A 8 pizza.txt | sed /\\[*.\\]/d | cut -f 2); do # finding [ratios] +8 tailing lines, removing the first.
((LABEL++))
grep 'ratios' -A 8 pizza.txt | sed /\\[*.\\]/d | cut -f 1 | sed $LABEL'!d' # same deal but itterating through the labels
echo $RATIO*$SIZE | bc # actually print the calculated number for each label
done
echo "scale = 2; ($RATIO*$SIZE)/1" | bc -l # actually print the calculated number for each label
done # we have to divide by 1 to.get the base to reset to actually apply the scale
# cleanup
unset LABEL
unset RATIO