Skip to content

Commit

Permalink
update formatter to match aws s3 ls --human-readable
Browse files Browse the repository at this point in the history
  • Loading branch information
heuermh committed May 22, 2024
1 parent d6e12dd commit 10712bc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final class HumanReadableFormatter {
private final DecimalFormat decimalFormat;

/** Multi-byte units, in binary. See https://en.wikipedia.org/wiki/Byte#Multiple-byte_units. */
static final String[] UNITS = new String[] { "B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB" };
static final String[] UNITS = new String[] { "Bytes", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB" };


/**
Expand All @@ -39,7 +39,7 @@ final class HumanReadableFormatter {
DecimalFormatSymbols symbols = new DecimalFormatSymbols();
symbols.setDecimalSeparator('.');

decimalFormat = new DecimalFormat("0.##", symbols);
decimalFormat = new DecimalFormat("0.#", symbols);
decimalFormat.setGroupingUsed(false);
}

Expand Down

0 comments on commit 10712bc

Please sign in to comment.