Feature #1110

Updated by Sebastien Jacquot over 5 years ago

1) Use the printf specifiers syntax to manage the number formats of the results in the TXM UI.
See: [[http://www.cplusplus.com/reference/cstdio/printf/]]

2) Add a global preference page for common shared formats by type, e.g. "percent", TBD: others types. Page name could be "User/Number formats" or FR: "Format d'affichage des résultats / formats numériques"

3) In the results preference page, as CA, empty by default all the column formats and inherit them from the global common shared formats by type when they are empty. When they are filled, use them instead of the inherited global formats.

For the point #2. There is a potential problem to display user friendly very small values. For example, eigenvalues are currently displayed in 2 different ways according to theirs values (if < 0.0001 => scientific notation (to avoid 0.0000 display) else => X.XXXX)
This behavior may not be possible by defining only one format preference (e.g. with printf it means "%.4f" and "%.4e").
But we may define 3 user preferences as "float", "small float", "very small float" then user could be define something as:

* float = "%.2f"
* small float = "%.2f"
* very small float = "%.4e"

Other solution, more complex but maybe more clean, is to centralize all the numeric outputs in a custom number formatter.

NOTE: the actual (DecimalFormat) and future (printf, String.format()) systems round numbers up (numbers are not truncated but rounded).

Back