Do we have a format that always includes a decimal point and a given number of significant digits, but otherwise drops unnecessary characters? For example, if I wanted 5 digits, I'd want the following:

Round to 5 digits:
1.234567  -> "1.2346"

Drop unnecessary zeros:
1.23      -> "1.23"

Force inclusion of a decimal point:
1         -> "1."

Duncan Murdoch

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to