Format$ now prints the expected number of decimal digits when using exponential format.

[INTERPRETER]
* BUG: Format$ now prints the expected number of decimal digits when using exponential format.
This commit is contained in:
gambas 2018-08-10 11:49:12 +02:00
parent dd53172230
commit a6a8d04b99

View file

@ -1015,7 +1015,12 @@ _FORMAT:
{
number_mant = frexp10(fabs(number), &number_exp);
ndigit = after;
if (!exposant) ndigit += number_exp;
if (!exposant)
ndigit += number_exp;
else
ndigit++;
ndigit = MinMax(ndigit, 0, MAX_FLOAT_DIGIT);
//fprintf(stderr, "number_mant = %.24g number_exp = %d ndigit = %d\n", number_mant, number_exp, ndigit);