Add engineering output mode

Similar to scientific mode, engineering mode also displays numbers in
base 10 exponential notation, with the difference that exponents are
always multiples of 3, to facilitate the interpretation in terms of
SI prefixes.

The mode is activated in config thru "engineering" or "eng. For base
and base2, it uses the special value 1000.
This commit is contained in:
Lucas Heitzmann Gabrielli
2021-06-07 14:11:07 -03:00
parent 3d33c6c6f4
commit 41b11ab785
8 changed files with 63 additions and 5 deletions

3
file.c
View File

@@ -1048,6 +1048,9 @@ idprintf(FILEID id, char *fmt, int count, VALUE **vals)
case 'e':
newmode = MODE_EXP;
break;
case 'n':
newmode = MODE_ENG;
break;
case 'g':
newmode = MODE_REAL_AUTO;
break;