Letting round_down_div_million() convert small numbers to 0

master
Thomas Schmitt 3 years ago
parent a28ad87aae
commit 98c301e7b9
  1. 14
      xorriso-dd-target/xorriso-dd-target

@ -117,8 +117,18 @@ print_usage() {
# Roughly convert human readable sizes and plain numbers to 1 / million
round_down_div_million() {
sed -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/'
sed \
-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

Loading…
Cancel
Save