From d16aa7f83af727f5495dd4883efb603dc8b941bb Mon Sep 17 00:00:00 2001 From: Raimo Niskanen Date: Thu, 9 Dec 2010 16:28:11 +0100 Subject: Fix ~F.Fs bug, add testcase and improve documentation --- lib/stdlib/doc/src/io.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/stdlib/doc/src/io.xml') 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

Prints the argument with the string syntax. The argument is, if no Unicode translation modifier is present, an I/O list, 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.

+ 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.

This format can be used for printing any object and truncating the output so it fits a specified field:

@@ -475,6 +475,8 @@ ok
ok 4> io:fwrite("|~10s|~n", [io_lib:write({hey, hey, hey})]). |{hey,hey,h| +5> io:fwrite("|~-10.8s|~n", [io_lib:write({hey, hey, hey})]). +|{hey,hey | ok

A list with integers larger than 255 is considered an error if the Unicode translation modifier is not given:

-- 
cgit v1.2.3