From: Mark-Jason Dominus Date: Tue, 27 Jun 2000 22:36:42 +0000 (-0400) Subject: DOC PATCH 5.6.0: perlfunc/sprintf does not contain an example X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fd9170040aeb30a1e02c294dc28a668d19088614;p=p5sagit%2Fp5-mst-13.2.git DOC PATCH 5.6.0: perlfunc/sprintf does not contain an example Message-ID: <20000628023642.12166.qmail@plover.com> p4raw-id: //depot/cfgperl@6248 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index ce08134..6b4e971 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -4379,9 +4379,18 @@ L, and L.) =item sprintf FORMAT, LIST -Returns a string formatted by the usual C conventions of the -C library function C. See L or L -on your system for an explanation of the general principles. +Returns a string formatted by the usual C conventions of the C +library function C. See below for more details +and see L or L on your system for an explanation of +the general principles. + +For example: + + # Format number with up to 8 leading zeroes + $result = sprintf("%08d", $number); + + # Round number to 3 digits after decimal point + $rounded = sprintf("%.3f", $number); Perl does its own C formatting--it emulates the C function C, but it doesn't use it (except for floating-point