---
name: "rust-numfmt"
section: "1"
platform: "linux"
package: "rust-coreutils"
version: "0.0.30-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rust-numfmt"
---

# rust-numfmt(1)

Convert numbers from/to human-readable strings

## NAME

numfmt - Convert numbers from/to human-readable strings

## SYNOPSIS

**numfmt** \[**-d**\|**--delimiter**\] \[**--field**\] \[**--format**\] \[**--from**\] \[**--from-unit**\] \[**--to**\] \[**--to-unit**\] \[**--padding**\] \[**--header**\] \[**--round**\] \[**--suffix**\] \[**--invalid**\] \[**-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\]

- **-h**, **--help**

  Print help

- **-V**, **--version**

  Print version

## EXTRA

UNIT options:

\- none: no auto-scaling is done; suffixes will trigger an error - auto: accept optional single/two letter suffix:

    1K = 1000, 1Ki = 1024, 1M = 1000000, 1Mi = 1048576,

\- si: accept optional single letter suffix:

    1K = 1000, 1M = 1000000, ...

\- iec: accept optional single letter suffix:

    1K = 1024, 1M = 1048576, ...

\- iec-i: accept optional two-letter suffix:

    1Ki = 1024, 1Mi = 1048576, ...

\- FIELDS supports [cut(1)](/cut/1.md) style field ranges:

    N    N'th field, counted from 1\
     N-   from N'th field, to end of line\
     N-M  from N'th to M'th field (inclusive)\
     \-M   from first to M'th field (inclusive)\
     \-    all fields

Multiple fields/ranges can be separated with commas

FORMAT must be suitable for printing one floating-point argument %f. Optional quote (%'f) will enable --grouping (if supported by current locale). Optional width value (%10f) will pad output. Optional zero (%010f) width will zero pad the number. Optional negative values (%-10f) will left align. Optional precision (%.1f) will override the input determined precision.

## VERSION

v0.0.30
