dtoa_eng(): use MEG instead of M for "mega" (M is considered as "milli" by spice)

This commit is contained in:
stefan schippers 2026-01-27 17:33:55 +01:00
parent fc5c5b97fe
commit 5365da9239
1 changed files with 4 additions and 1 deletions

View File

@ -604,7 +604,10 @@ char *dtoa_eng(double i, int precision)
else { i *= 1e18; suffix = 'a';}
if(suffix) {
/* can not use my_snprintf() here due to indirect precision */
n = sprintf(s, "%.*g%c", precision, i, suffix);
if(suffix == 'M')
n = sprintf(s, "%.*gMEG", precision, i);
else
n = sprintf(s, "%.*g%c", precision, i, suffix);
} else {
n = sprintf(s, "%.*g", precision, i);
}