aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/io_lib_format.erl
diff options
context:
space:
mode:
authorAli Yakout <[email protected]>2010-11-24 13:24:14 +0200
committerRaimo Niskanen <[email protected]>2011-03-10 08:30:50 +0100
commit06c100a28736cfb6a3d8855298bf4be2eec198f6 (patch)
tree1f57c4cc0dcce05f4aaac29c23e51ea7176da849 /lib/stdlib/src/io_lib_format.erl
parent8533b8bcae728783b1c066b9fecb96b1cc2eb03c (diff)
downloadotp-06c100a28736cfb6a3d8855298bf4be2eec198f6.tar.gz
otp-06c100a28736cfb6a3d8855298bf4be2eec198f6.tar.bz2
otp-06c100a28736cfb6a3d8855298bf4be2eec198f6.zip
io_lib_format string precision fix
Diffstat (limited to 'lib/stdlib/src/io_lib_format.erl')
-rw-r--r--lib/stdlib/src/io_lib_format.erl4
1 files changed, 1 insertions, 3 deletions
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.