aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranz Zotter <fzotter@users.sourceforge.net>2007-08-29 14:36:17 +0000
committerFranz Zotter <fzotter@users.sourceforge.net>2007-08-29 14:36:17 +0000
commitfd894c0e7308a40150c1e09b496a6cea40852189 (patch)
tree3a592f1fb7761da955c9440a0f03ca725ac324ad
parent2dff17ddaa099e5fe9be9b4306d91f38300a13b2 (diff)
added a "g" instead of the "f" to fwriteln.c for better precision, when using small or large numbers.:w
svn path=/trunk/externals/zexy/; revision=8692
-rw-r--r--src/fwriteln.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fwriteln.c b/src/fwriteln.c
index 5fa6679..882ed28 100644
--- a/src/fwriteln.c
+++ b/src/fwriteln.c
@@ -181,7 +181,7 @@ static void *fwriteln_new(t_symbol *s, int argc, t_atom *argv)
x->x_textbuf=0;
x->width=5;
x->precision=2;
- strcpy(x->format_string_afloats,"%*.*f ");
+ strcpy(x->format_string_afloats,"%*.*g ");
for (k=0; k<argc; k++) {
if ((atom_getsymbol(&argv[k])==gensym("p"))&&(k+1<argc)) {
x->precision=atom_getint(&argv[++k]);
@@ -194,10 +194,10 @@ static void *fwriteln_new(t_symbol *s, int argc, t_atom *argv)
x->width=(x->width>40)?40:x->width;
}
else if (atom_getsymbol(&argv[k])==gensym("-")) {
- strcpy(x->format_string_afloats,"%-*.*f ");
+ strcpy(x->format_string_afloats,"%-*.*g ");
}
else if (atom_getsymbol(&argv[k])==gensym("+")) {
- strcpy(x->format_string_afloats,"%+*.*f ");
+ strcpy(x->format_string_afloats,"%+*.*g ");
}
}
return (void *)x;