A recreation of the stats:::format.prec function that is only available internally to the stats package.
Usage
format_perc_api2lm(probs, digits)
Value
A vector of percentages
Arguments
probs
A vector of probabilities.
digits
a positive integer indicating how many significant digits
are to be used for
numeric and complex x. The default, NULL, uses
getOption("digits"). This is a suggestion: enough decimal
places will be used so that the smallest (in magnitude) number has
this many significant digits, and also to satisfy nsmall.
(For more, notably the interpretation for complex numbers see
signif.)