Bug 385 enable variable numdgt for printout

This commit is contained in:
Holger Vogt 2018-12-14 00:52:38 +01:00
parent f6b995b80e
commit c2db1d5547
1 changed files with 8 additions and 2 deletions

View File

@ -369,13 +369,19 @@ static void print_data(
int nargs) /* The size of the value array */
{
int i;
int i, preci;
char step_str[100];
/* If option numdgt is set, use it for printout precision. */
if (cp_numdgt > 0)
preci = cp_numdgt;
else
preci = 9;
if(dcop)
strcpy(step_str, "DCOP ");
else
sprintf(step_str, "%-16.9e", step);
sprintf(step_str, "%.*e", preci, step);
out_printf("%s", step_str);
for(i = 0; i < nargs; i++)