1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-11 13:01:28 +02:00

16423: append a `.' to converted floating point output

to stop it looking like an integer
This commit is contained in:
Peter Stephenson 2002-01-10 10:55:20 +00:00
parent 99d54b0b70
commit 324e26d8ce
2 changed files with 9 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2002-01-10 Peter Stephenson <pws@csr.com>
* 16423: Src/params.c: Don't let convfloat output a number
looking like an integer; append a `.' if necessary. Otherwise
the wrong type of arithmetic will be used on numbers stored in
scalars.
2002-01-09 Peter Stephenson <pws@csr.com>
* 16422: Functions/Misc/zcalc: fix output in bases when

View file

@ -3357,6 +3357,8 @@ convfloat(double dval, int digits, int flags, FILE *fout)
} else {
VARARR(char, buf, 512 + digits);
sprintf(buf, fmt, digits, dval);
if (!strchr(buf, 'e') && !strchr(buf, '.'))
strcat(buf, ".");
return dupstring(buf);
}
}