From 06c100a28736cfb6a3d8855298bf4be2eec198f6 Mon Sep 17 00:00:00 2001 From: Ali Yakout Date: Wed, 24 Nov 2010 13:24:14 +0200 Subject: io_lib_format string precision fix --- lib/stdlib/src/io_lib_format.erl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/stdlib/src/io_lib_format.erl b/lib/stdlib/src/io_lib_format.erl index eb1885021d..7c04d78ce8 100644 --- a/lib/stdlib/src/io_lib_format.erl +++ b/lib/stdlib/src/io_lib_format.erl @@ -573,9 +573,7 @@ string(S, F, Adj, F, Pad) -> string(S, none, Adj, F, Pad); string(S, F, Adj, P, Pad) when F > P -> N = lists:flatlength(S), - if N > F -> flat_trunc(S, F); - N =:= F -> S; - N > P -> adjust(flat_trunc(S, P), chars(Pad, F-P), Adj); + if N > P -> adjust(flat_trunc(S, P), chars(Pad, F-P), Adj); N =:= P -> adjust(S, chars(Pad, F-P), Adj); true -> adjust([S|chars(Pad, P-N)], chars(Pad, F-P), Adj) end. -- cgit v1.2.3