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:
parent
99d54b0b70
commit
324e26d8ce
2 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue