mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-10-06 09:53:00 +02:00
Yet another fix to the ext2spice code handling output formatting
of SI values, this time to put the precision and the value in the order that is generally more accepted. The gcc compiler, at least, doesn't seem to care which order they are given in.
This commit is contained in:
@@ -3164,7 +3164,7 @@ esSIvalue(file, value)
|
||||
char ptest[32];
|
||||
float pvalue;
|
||||
|
||||
sprintf(ptest, "%.*g", value, precision);
|
||||
sprintf(ptest, "%.*g", precision, value);
|
||||
sscanf(ptest, "%f", &pvalue);
|
||||
vtrunc = (int)(0.5 + (value * 1e6));
|
||||
ptrunc = (int)(0.5 + (pvalue * 1e6));
|
||||
@@ -3172,9 +3172,9 @@ esSIvalue(file, value)
|
||||
}
|
||||
|
||||
if (suffix == '\0')
|
||||
fprintf(file, "%.*g", value, precision);
|
||||
fprintf(file, "%.*g", precision, value);
|
||||
else
|
||||
fprintf(file, "%.*%c", value, precision, suffix);
|
||||
fprintf(file, "%.*g%c", precision, value, suffix);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user