aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/doc/src/io.xml
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2010-12-09 16:28:11 +0100
committerRaimo Niskanen <[email protected]>2011-03-10 08:37:38 +0100
commitd16aa7f83af727f5495dd4883efb603dc8b941bb (patch)
tree22db911d07637083e68fca044bf6449f2bc5d865 /lib/stdlib/doc/src/io.xml
parent06c100a28736cfb6a3d8855298bf4be2eec198f6 (diff)
downloadotp-d16aa7f83af727f5495dd4883efb603dc8b941bb.tar.gz
otp-d16aa7f83af727f5495dd4883efb603dc8b941bb.tar.bz2
otp-d16aa7f83af727f5495dd4883efb603dc8b941bb.zip
Fix ~F.Fs bug, add testcase and improve documentation
Diffstat (limited to 'lib/stdlib/doc/src/io.xml')
-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>