-
Notifications
You must be signed in to change notification settings - Fork 643
Switch to binary prefixes #7218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We display KIB
in the version list and KiB
in the crate view. I suggestion to unify them to KiB
. The KIB
caused by this CSS:
text-transform: uppercase; |
Thanks!
app/helpers/pretty-bytes.js
Outdated
* See https://github.com/rust-lang/crates.io/discussions/7177 | ||
* | ||
* Here we set fraction digits to 1 because `cargo publish` | ||
* uses this format (see https://github.com/rust-lang/cargo/blob/master/src/cargo/ops/cargo_package.rs#L168-L171) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please use a tag instead of the master branch here?
Using a fixed version can make sure we can always find it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I see! I'll fix them...
thanks :) |
prettyBytes(bytes, { | ||
binary: true, | ||
...options, | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Turbo87, what's the point of "making it possible to override these defaults", if it is never (AFAIU) overridden anywhere?
In #7177 (comment) I intentionally wrote {...options, binary: true}
so that binary prefixes will be anywhere and everywhere (that was the point from the start).
This is from
and changes the unit of package size to use binary prefixes as shown in test cases in
tests/unit/helpers/pretty-bytes-test.js
.