Letting round_down_div_million() convert small numbers to 0

This commit is contained in:
Thomas Schmitt 2019-12-05 20:11:19 +01:00
parent a28ad87aae
commit 98c301e7b9

View File

@ -117,8 +117,18 @@ print_usage() {
# Roughly convert human readable sizes and plain numbers to 1 / million # Roughly convert human readable sizes and plain numbers to 1 / million
round_down_div_million() { round_down_div_million() {
sed -e 's/\.[0-9]*//' -e 's/[0-9][0-9][0-9][0-9][0-9][0-9]$//' \ sed \
-e 's/[Mm]//' -e 's/[Gg]/000/' -e 's/[Tt]/000000/' -e 's/^[0-9][0-9][0-9][0-9][0-9][0-9]$/0/' \
-e 's/^[0-9][0-9][0-9][0-9][0-9]$/0/' \
-e 's/^[0-9][0-9][0-9][0-9]$/0/' \
-e 's/^[0-9][0-9][0-9]$/0/' \
-e 's/^[0-9][0-9]$/0/' \
-e 's/^[0-9]$/0/' \
-e 's/\.[0-9]*//' \
-e 's/[0-9][0-9][0-9][0-9][0-9][0-9]$//' \
-e 's/[Mm]$//' \
-e 's/[Gg]$/000/' \
-e 's/[Tt]$/000000/'
} }
### Assessing arguments and setting up the job ### Assessing arguments and setting up the job