summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2015-06-19 19:18:21 +0100
committerPádraig Brady <P@draigBrady.com>2015-06-21 04:16:29 +0100
commit0a279f619055cc165bb3cfa3bb737cdd28ed4d70 (patch)
tree6149ce7f474051369efba96680228e3e0b5716db /doc
parent71063bc858cd927e3622b511297e66b3e13f7453 (diff)
downloadcoreutils-0a279f619055cc165bb3cfa3bb737cdd28ed4d70.tar.xz
numfmt: support user specified output precision
* src/numfmt.c (usage): Update the --format description to indicate precision is allowed. (parse_format_string): Parse a precision specification like the standard printf does. (double_to_human): Honor the precision in --to mode. * tests/misc/numfmt.pl: New tests. * doc/coreutils.texi (numfmt invocation): Mention the new feature. * NEWS: Likewise.
Diffstat (limited to 'doc')
-rw-r--r--doc/coreutils.texi14
1 files changed, 8 insertions, 6 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 9197cb426..c4f3a07c1 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -16909,12 +16909,14 @@ N-M from N'th to M'th field (inclusive)
@item --format=@var{format}
@opindex --format
Use printf-style floating FORMAT string. The @var{format} string must contain
-one @samp{%f} directive, optionally with @samp{'}, @samp{-}, @samp{0}, or width
-modifiers. The @samp{'} modifier will enable @option{--grouping}, the @samp{-}
-modifier will enable left-aligned @option{--padding} and the width modifier will
-enable right-aligned @option{--padding}. The @samp{0} width modifier
-(without the @samp{-} modifier) will generate leading zeros on the number,
-up to the specified width.
+one @samp{%f} directive, optionally with @samp{'}, @samp{-}, @samp{0}, width
+or precision modifiers. The @samp{'} modifier will enable @option{--grouping},
+the @samp{-} modifier will enable left-aligned @option{--padding} and the width
+modifier will enable right-aligned @option{--padding}. The @samp{0} width
+modifier (without the @samp{-} modifier) will generate leading zeros on the
+number, up to the specified width. A precision specification like @samp{%.1f}
+will override the precision determined from the input data or set due to
+@option{--to} option auto scaling.
@item --from=@var{unit}
@opindex --from