[project @ 2003-01-11 04:23:24 by jwe]
author |
jwe |
date |
Sat, 11 Jan 2003 04:23:24 +0000 |
parents |
755f6509bb01 |
children |
399595b12ca7 |
files |
scripts/ChangeLog scripts/general/num2str.m |
diffstat |
2 files changed, 9 insertions(+), 1 deletions(-)
[+]
|
line diff
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,7 @@
+2003-01-10 John W. Eaton <jwe@bevo.che.wisc.edu>
+
+ * general/num2str.m: Don't specify field width for scalars.
+
2003-01-05 John W. Eaton <jwe@bevo.che.wisc.edu>
* Makefile.in (DISTFILES): Don't forget mkpkgadd.
--- a/scripts/general/num2str.m
+++ b/scripts/general/num2str.m
@@ -39,7 +39,11 @@
fmt = sprintf ("%%.%dg", arg);
endif
else
- fmt = "%11.4g";
+ if (isscalar (x))
+ fmt = "%.4g";
+ else
+ fmt = "%11.4g";
+ endif
endif
if (iscomplex (x))
error ("num2str: sorry, can't handle complex numbers yet");