aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/doc/src
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2011-03-11 09:52:03 +0100
committerRaimo Niskanen <[email protected]>2011-03-11 09:52:03 +0100
commit7c77ebba4f3905dbbd8db5898ffcaf265286f5d8 (patch)
tree643dd823315ce1f91d5aa5b33601e3cdee88be2e /lib/stdlib/doc/src
parentdf454656f37296a47834ba8b01ec54f3638addba (diff)
parentd16aa7f83af727f5495dd4883efb603dc8b941bb (diff)
downloadotp-7c77ebba4f3905dbbd8db5898ffcaf265286f5d8.tar.gz
otp-7c77ebba4f3905dbbd8db5898ffcaf265286f5d8.tar.bz2
otp-7c77ebba4f3905dbbd8db5898ffcaf265286f5d8.zip
Merge branch 'ay/precisionfix/OTP-8989' into dev
* ay/precisionfix/OTP-8989: Fix ~F.Fs bug, add testcase and improve documentation io_lib_format string precision fix
Diffstat (limited to 'lib/stdlib/doc/src')
-rw-r--r--lib/stdlib/doc/src/io.xml8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/stdlib/doc/src/io.xml b/lib/stdlib/doc/src/io.xml
index efbb1fc078..81fb5cad3d 100644
--- a/lib/stdlib/doc/src/io.xml
+++ b/lib/stdlib/doc/src/io.xml
@@ -464,9 +464,9 @@ ok</pre>
<p>Prints the argument with the <c>string</c> syntax. The
argument is, if no Unicode translation modifier is present, an
<seealso marker="erts:erlang#iolist_definition">I/O list</seealso>, a binary, or an atom. If the Unicode translation modifier ('t') is in effect, the argument is chardata(), meaning that binaries are in UTF-8. The characters
- are printed without quotes. In this format, the printed
- argument is truncated to the given precision and field
- width.</p>
+ are printed without quotes. The string is first truncated
+ by the given precision and then padded and justified
+ to the given field width. The default precision is the field width.</p>
<p>This format can be used for printing any object and
truncating the output so it fits a specified field:</p>
<pre>
@@ -475,6 +475,8 @@ ok</pre>
ok
4> <input>io:fwrite("|~10s|~n", [io_lib:write({hey, hey, hey})]).</input>
|{hey,hey,h|
+5> <input>io:fwrite("|~-10.8s|~n", [io_lib:write({hey, hey, hey})]).</input>
+|{hey,hey |
ok</pre>
<p>A list with integers larger than 255 is considered an error if the Unicode translation modifier is not given:</p>
<pre>