Skip to content

Commit

Permalink
Cosmetic changes to the way the percentage is shown in show-size-chan…
Browse files Browse the repository at this point in the history
…ges.sh
  • Loading branch information
aadsm committed Feb 22, 2024
1 parent 7010531 commit 56e10ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/show-size-changes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ eval "git diff-index HEAD $@" | {
# Calculate the percentage up to 2 decimal places and leading 0 when the
# percentage only has the decimal part. Only print percentages >= 0.01%.
bc_expr="scale=2; v=$size_diff/$sizeB"
bc_expr=$bc_expr'; if (v >= 0.01) { if (v < 0) { print "-" } else { print "+" }; if (abs(v) < 1) print "0"; print abs(v) }; print ""'
bc_expr=$bc_expr'; if (v >= 0.01) { if (v < 0) { print "-" } else { print "+" }; if (abs(v) < 1) print "0"; print abs(v); print "% " }; print ""'
perc=$(bc -e "$bc_expr")
echo -e "$path $size_diff_color$size_diff_signal$size_diff $perc$TC($sizeB -> $sizeA)"
done
Expand Down

0 comments on commit 56e10ee

Please sign in to comment.