Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/uu/numfmt/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,8 @@ fn transform_to(
precision: usize,
unit_separator: &str,
) -> Result<String> {
let (i2, s) = consider_suffix(s, opts.to, round_method, precision)?;
let i2 = i2 / (opts.to_unit as f64);
let i2 = s / (opts.to_unit as f64);
let (i2, s) = consider_suffix(i2, opts.to, round_method, precision)?;
Ok(match s {
None => {
format!(
Expand Down
6 changes: 1 addition & 5 deletions tests/by-util/test_numfmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1436,12 +1436,8 @@ fn test_zero_pad_sign_order_issue_11664() {
.stdout_is("-00000009869647.00\n");
}

// https://github.com/uutils/coreutils/issues/11666
// `--to-unit=N` selects the output prefix based on the unscaled value
// instead of `value / N`.
#[test]
#[ignore = "GNU compat: see uutils/coreutils#11666"]
fn test_to_unit_prefix_selection_issue_11666() {
fn test_to_unit_prefix_selection() {
new_ucmd!()
.args(&["--to=iec-i", "--to-unit=885", "100000"])
.succeeds()
Expand Down
Loading