1 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35.
2 .TH NUMFMT "1" "May 2014" "GNU coreutils 8.21" "User Commands"
4 numfmt \- Convert numbers from/to human-readable strings
7 [\fIOPTION\fR]... [\fINUMBER\fR]...
9 .\" Add any additional description here
11 Reformat NUMBER(s), or the numbers from standard input if none are specified.
13 Mandatory arguments to long options are mandatory for short options too.
16 print warnings about invalid input
18 \fB\-d\fR, \fB\-\-delimiter\fR=\fIX\fR
19 use X instead of whitespace for field delimiter
21 \fB\-\-field\fR=\fIN\fR
22 replace the number in input field N (default is 1)
24 \fB\-\-format\fR=\fIFORMAT\fR
25 use printf style floating\-point FORMAT;
26 see FORMAT below for details
28 \fB\-\-from\fR=\fIUNIT\fR
29 auto\-scale input numbers to UNITs; default is 'none';
32 \fB\-\-from\-unit\fR=\fIN\fR
33 specify the input unit size (instead of the default 1)
36 use locale\-defined grouping of digits, e.g. 1,000,000
37 (which means it has no effect in the C/POSIX locale)
39 \fB\-\-header\fR[=\fIN\fR]
40 print (without converting) the first N header lines;
41 N defaults to 1 if not specified
43 \fB\-\-invalid\fR=\fIMODE\fR
44 failure mode for invalid numbers: MODE can be:
45 abort (default), fail, warn, ignore
47 \fB\-\-padding\fR=\fIN\fR
48 pad the output to N characters; positive N will
49 right\-align; negative N will left\-align;
50 padding is ignored if the output is wider than N;
51 the default is to automatically pad if a whitespace
54 \fB\-\-round\fR=\fIMETHOD\fR
55 use METHOD for rounding when scaling; METHOD can be:
56 up, down, from\-zero (default), towards\-zero, nearest
58 \fB\-\-suffix\fR=\fISUFFIX\fR
59 add SUFFIX to output numbers, and accept optional
60 SUFFIX in input numbers
62 \fB\-\-to\fR=\fIUNIT\fR
63 auto\-scale output numbers to UNITs; see UNIT below
65 \fB\-\-to\-unit\fR=\fIN\fR
66 the output unit size (instead of the default 1)
69 display this help and exit
72 output version information and exit
76 no auto\-scaling is done; suffixes will trigger an error
79 accept optional single/two letter suffix:
87 accept optional single letter suffix:
94 accept optional single letter suffix:
101 accept optional two\-letter suffix:
107 FORMAT must be suitable for printing one floating\-point argument '%f'.
108 Optional quote (%'f) will enable \fB\-\-grouping\fR (if supported by current locale).
109 Optional width value (%10f) will pad output. Optional negative width values
110 (%\-10f) will left\-pad output.
112 Exit status is 0 if all input numbers were successfully converted.
113 By default, numfmt will stop at the first conversion error with exit status 2.
114 With \fB\-\-invalid=\fR'fail' a warning is printed for each conversion error
115 and the exit status is 2. With \fB\-\-invalid=\fR'warn' each conversion error is
116 diagnosed, but the exit status is 0. With \fB\-\-invalid=\fR'ignore' conversion
117 errors are not diagnosed and the exit status is 0.
120 \f(CW$ numfmt --to=si 1000\fR
124 \f(CW$ numfmt --to=iec 2048\fR
128 \f(CW$ numfmt --to=iec-i 4096\fR
132 \f(CW$ echo 1K | numfmt --from=si\fR
136 \f(CW$ echo 1K | numfmt --from=iec\fR
140 \f(CW$ df | numfmt --header --field 2 --to=si\fR
142 \f(CW$ ls -l | numfmt --header --field 5 --to=iec\fR
144 \f(CW$ ls -lh | numfmt --header --field 5 --from=iec --padding=10\fR
146 \f(CW$ ls -lh | numfmt --header --field 5 --from=iec --format %10f\fR
148 Written by Assaf Gordon.
150 Report numfmt bugs to bug\-coreutils@gnu.org
152 GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
154 General help using GNU software: <http://www.gnu.org/gethelp/>
156 Report numfmt translation bugs to <http://translationproject.org/team/>
158 Copyright \(co 2013 Free Software Foundation, Inc.
159 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
161 This is free software: you are free to change and redistribute it.
162 There is NO WARRANTY, to the extent permitted by law.
164 The full documentation for
166 is maintained as a Texinfo manual. If the
170 programs are properly installed at your site, the command
172 .B info coreutils \(aqnumfmt invocation\(aq
174 should give you access to the complete manual.