diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-01-24 08:47:24 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-01-24 08:47:24 (GMT) |
commit | 8a7371192ad16bddf778f223a0e1a44425823832 (patch) | |
tree | 4a05e7c871d34a006b906aef9933435e880db71b /doc | |
parent | ac67b57981118fba9be90a056088437f577693d5 (diff) | |
parent | 0abda82b1ef6d5a059df46d1706ae64157523fe7 (diff) | |
download | tcl-8a7371192ad16bddf778f223a0e1a44425823832.zip tcl-8a7371192ad16bddf778f223a0e1a44425823832.tar.gz tcl-8a7371192ad16bddf778f223a0e1a44425823832.tar.bz2 |
merge core-8-branch. Improve documentation (format.n).
Diffstat (limited to 'doc')
-rw-r--r-- | doc/format.n | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/doc/format.n b/doc/format.n index 1df255e..7ae8a2f 100644 --- a/doc/format.n +++ b/doc/format.n @@ -83,15 +83,15 @@ Specifies that the number should be padded on the left with zeroes instead of spaces. .TP 10 \fB#\fR -Requests an alternate output form. For \fBo\fR and \fBO\fR -conversions it guarantees that the first digit is always \fB0\fR. -For \fBx\fR or \fBX\fR conversions, \fB0x\fR or \fB0X\fR (respectively) +Requests an alternate output form. For \fBo\fR conversions, \fB0o\fR +will be added to the beginning of the result unless it is zero. +For \fBx\fR or \fBX\fR conversions, \fB0x\fR will be added to the beginning of the result unless it is zero. For \fBb\fR conversions, \fB0b\fR will be added to the beginning of the result unless it is zero. For \fBd\fR conversions, \fB0d\fR there is no effect unless -the \fB0\fR specifier is used as well: In that case, \fB0d\fR or -\fB0D\fR (respectively) will be added to the beginning. +the \fB0\fR specifier is used as well: In that case, \fB0d\fR +will be added to the beginning. For all floating-point conversions (\fBe\fR, \fBE\fR, \fBf\fR, \fBg\fR, and \fBG\fR) it guarantees that the result always has a decimal point. @@ -203,6 +203,10 @@ Trailing zeroes and a trailing decimal point are omitted. .TP 10 \fB%\fR No conversion: just insert \fB%\fR. +.TP 10 +\fBp\fR +Shorthand form for \fB0x%zx\fR, so it outputs the integer in +hexadecimal form with \fB0x\fR prefix. .SH "DIFFERENCES FROM ANSI SPRINTF" .PP The behavior of the format command is the same as the @@ -211,13 +215,12 @@ differences: .IP [1] Tcl guarantees that it will be working with UNICODE characters. .IP [2] -\fB%p\fR and \fB%n\fR specifiers are not supported. +\fB%n\fR specifier is not supported. .IP [3] For \fB%c\fR conversions the argument must be an integer value, which will then be converted to the corresponding character value. .IP [4] The size modifiers are ignored when formatting floating-point values. -The \fBll\fR modifier has no \fBsprintf\fR counterpart. The \fBb\fR specifier has no \fBsprintf\fR counterpart. .SH EXAMPLES .PP |