summaryrefslogtreecommitdiff
path: root/pod/perlfunc.pod
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2016-02-03 11:35:28 +1100
committerJames E Keenan <jkeenan@cpan.org>2016-02-02 20:49:59 -0500
commitc95ea6823bf0611c3ce863cdc508a66b52523d34 (patch)
tree5740f360c39c7b34d23fd9535e156b96922002d0 /pod/perlfunc.pod
parent42d92f4a6420c9e925e441055e97be24645d0a52 (diff)
downloadperl-c95ea6823bf0611c3ce863cdc508a66b52523d34.tar.gz
Clarify sprintf() handling of + and space flags
Also with contribution by Chas. Owens. For: RT #125471
Diffstat (limited to 'pod/perlfunc.pod')
-rw-r--r--pod/perlfunc.pod6
1 files changed, 5 insertions, 1 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 1dba05a3fe..126bcb1eaf 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -7167,7 +7167,11 @@ one or more of:
For example:
printf '<% d>', 12; # prints "< 12>"
+ printf '<% d>', 0; # prints "< 0>"
+ printf '<% d>', -12; # prints "<-12>"
printf '<%+d>', 12; # prints "<+12>"
+ printf '<%+d>', 0; # prints "<+0>"
+ printf '<%+d>', -12; # prints "<-12>"
printf '<%6s>', 12; # prints "< 12>"
printf '<%-6s>', 12; # prints "<12 >"
printf '<%06s>', 12; # prints "<000012>"
@@ -7178,7 +7182,7 @@ For example:
printf '<%#B>', 12; # prints "<0B1100>"
When a space and a plus sign are given as the flags at once,
-a plus sign is used to prefix a positive number.
+the space is ignored.
printf '<%+ d>', 12; # prints "<+12>"
printf '<% +d>', 12; # prints "<+12>"