Fixes #20. This implements pretty formatting for floating point values in the evaluator output. It limits their precision to maximally two decimal places and supports metric prefixes. Especially for large integers (e.g. counts) we don't want a loss of precision, so those are unaffected by the pretty printing and will use the default formatting provided by evalexpr like other value types. A space is added between the value and metric prefix if a unit is provided, following the conventions defined for the SI units. This work also introduces unit tests for the pretty printing as the first module to do so in this codebase :sweat_smile:
Fixes #20. This implements pretty formatting for floating point values in the evaluator output. It limits their precision to maximally two decimal places and supports metric prefixes. Especially for large integers (e.g. counts) we don't want a loss of precision, so those are unaffected by the pretty printing and will use the default formatting provided by
evalexpr
like other value types. A space is added between the value and metric prefix if a unit is provided, following the conventions defined for the SI units. This work also introduces unit tests for the pretty printing as the first module to do so in this codebase :sweat_smile: