uudoc(1)

NAME
uudoc - Convert numbers from/to human-readable strings

SYNOPSIS
uudoc [-d|--delimiter] [--field] [--format] [--from] [--from-unit] [--to] [--to-unit] [--padding] [--header] [--round] [--suffix] [--invalid] [-z|--zero-terminated] [-h|--help] [-V|--version] [NUMBER]

DESCRIPTION
Convert numbers from/to human-readable strings

OPTIONS

-d, --delimiter <X>
    use X instead of whitespace for field delimiter

--field <FIELDS> [default: 1]
    replace the numbers in these input fields; see FIELDS below

--format <FORMAT>
    use printf style floating-point FORMAT; see FORMAT below for details

--from <UNIT> [default: none]
    auto-scale input numbers to UNITs; see UNIT below

--from-unit <N> [default: 1]
    specify the input unit size

--to <UNIT> [default: none]
    auto-scale output numbers to UNITs; see UNIT below

--to-unit <N> [default: 1]
    the output unit size

--padding <N>
    pad the output to N characters; positive N will right-align; negative N will left-align; padding is ignored if the output is wider than N; the default is to automatically pad if a whitespace is found

--header [<N>]
    print (without converting) the first N header lines; N defaults to 1 if not specified

--round <METHOD> [default: from-zero]
    use METHOD for rounding when scaling
    [possible values: up, down, from-zero, towards-zero, nearest]

--suffix <SUFFIX>
    print SUFFIX after each formatted number, and accept inputs optionally ending with SUFFIX

--invalid <INVALID> [default: abort]
    set the failure mode for invalid input
    [possible values: abort, fail, warn, ignore]

-z, --zero-terminated
    line delimiter is NUL, not newline

-h, --help
    Print help

-V, --version
    Print version

EXTRA
Examples Convert 1.5K (SI Units) to 1500: numfmt --from si 1.5K Convert 1500 to 1.5K (SI Units): numfmt --to si 1500 Convert 1.5K (IEC Units) to 1536: numfmt --from iec 1.5K Use appropriate conversion based on the suffix: numfmt --from auto {{1.5Ki}} Convert 5th field (1-indexed) to IEC Units without converting header: ls -l | numfmt --header=1 --field 5 --to iec Convert to IEC units, pad with 5 characters, left aligned: du {{[-s|--summarize]}} * | numfmt --to iec --format "%-5f" > The examples are provided by the [tldr-pages project](https://tldr.sh) under the [CC BY 4.0 License](https://github.com/tldr-pages/tldr/blob/main/LICENSE.md). > > Please note that, as uutils is a work in progress, some examples might fail.

VERSION
v(uutils coreutils) 0.4.0