comparison scripts/general/int2str.m @ 12080:16a1e60b4701 release-3-2-x

fix int2str
author Jaroslav Hajek <highegg@gmail.com>
date Tue, 01 Sep 2009 09:32:38 +0200
parents eb63fbe60fab
children 95c3e38098bf
comparison
equal deleted inserted replaced
12079:295001bff26d 12080:16a1e60b4701
100 if (isempty (t)) 100 if (isempty (t))
101 ## Only zeros, Inf, and NaN. 101 ## Only zeros, Inf, and NaN.
102 fmt = sprintf ("%%%dd", min_fw); 102 fmt = sprintf ("%%%dd", min_fw);
103 else 103 else
104 ## Could have anything. 104 ## Could have anything.
105 tfw = floor (log10 (abs (t))) + 1 + sep; 105 tfw = floor (log10 (double (abs (t)))) + 1 + sep;
106 fw = max (tfw); 106 fw = max (tfw);
107 if (any (t(tfw == fw) < 0)) 107 if (any (t(tfw == fw) < 0))
108 fw++; 108 fw++;
109 endif 109 endif
110 fmt = sprintf ("%%%dd", max (fw, min_fw)); 110 fmt = sprintf ("%%%dd", max (fw, min_fw));