Post Reply 
newRPL: Number formatting on screen
07-08-2015, 01:25 PM
Post: #1
newRPL: Number formatting on screen
The basic number format needs as input:
* Mode:
Standard: 123400000
SCI: 1.234E8

* Number of digits to display: For standard mode, this number is the number of figures after decimal dot. For all others this is the total number of significant figures to display.

* Configurable characters based on locale for: decimal dot, thousand separator, fractional part separator, and exponent letter (e or E?)

* A few true/false flags for:
a) Add thousand separator: 1,000,000.0 (as example, using comma for separator)
b) Fractional part separator: 0.123 456 789 (as example, using space as separator)
c) Show trailing zeros (FIX): 123.0000 instead of 123
d) Adjust exponent to multiple of 3 (ENG)

Question: Can these simplified options cover all cases? am I missing some other formatting options?

For example, the number 123456789:
Standard, 6 digits: 123456789
Standard, 6 digits, trailing zeros: 123456789.000000
Standard 6 digits, trailing zeros, thousand and frac. separator: 123,456,789.000 000
Sci, 6 digits: 1.23457E8
Sci, 12 digits: 1.23456789E8
Sci, 12 digits, trailing zeros: 1.23456789000E8
Sci, 12 digits, trailing zeros, frac. separator: 1.234 567 890 00E8
Sci, adjust exponent ENG, 12 digits: 123.456789E6

Notice there's some flexibility here not present in the 50g. In Sci mode, the 50g always shows the same number of digits. Here you have the option to display or not any trailing zeros. So the number 2.5 in SCI notation can be 2.5E0 even if you select 6 digits. If you like the trailing zeros, then activate the flag and it will become 2.50000E0.
In standard notation, the trailing zeros acts like the FIX mode. For example, with 6 digits selected (at 36 digit precision), doing 2 3 / will display 0.666667, but 2 4 / will only show 0.5 unless trailing zeros is selected.

I also have the idea of having 3 different and independent formats (each selected as above) active all the time:
* Big numbers
* Mid-range
* Small numbers

There should be a user configurable cut-off between these ranges. For example, I personally like numbers above 10 million to be in SCI notation, numbers smaller than 0.0001 also in SCI notation, but everything in between in standard notation.
So my preferred configuration would be something like:
Big number cut-off: 10000000
Big number format: Sci, 12 digit
Small number cut-off: 0.0001
Small number format: Sci, 6 digit
Other numbers: Standard, 6 digit

The 50g has fixed cut-off limits when in standard mode. Numbers 1e12 and above are forced into SCI notation, numbers 1E-13 and below are forced into SCI notation.

Is this useful or an unnecessary overkill?

For the command line, formatting options will be respected as much as possible during edit, except that:
* All digits must be edited, so the number can be fully recompiled to its previous value. Therefore, display digit count is ignored if the number has more digits than requested.
* Thousand and fraction separators are not included when editing a number.
* Trailing zeros are included only if the number has less than the requested number of digits.

Any other options needed?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
newRPL: Number formatting on screen - Claudio L. - 07-08-2015 01:25 PM



User(s) browsing this thread: 1 Guest(s)