ddalthorp / GenEst

R package development for a generalized mortality estimator
Other
6 stars 6 forks source link

output: trailing zeros #417

Closed ddalthorp closed 6 years ago

ddalthorp commented 6 years ago

Do not truncate trailing zeros more than other digits. Unfortunately, this is something R is not great at.

E.g., round(14.12, 1) --> 14.1 round(14.02, 1) --> 14 rather than the desired 14.0

sprintf('%.1f', 14.02) --> "14.0", which is just right for printing but must be cast as numeric before using in calculations.

ddalthorp commented 6 years ago

Store calculation results as returned by R (i.e., all digits), but for display of summary statistics in GUI, show only the "desired" number of digits via sprintf.

ddalthorp commented 6 years ago

This is an intricate issue that we should table for the time being.