Skip to content

Commit 39b3e59

Browse files
committed
restore digits option
1 parent 9c808db commit 39b3e59

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

R/print.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#'
55
#' @param x an \code{errors} object.
66
#' @param digits how many significant digits are to be used for uncertainties.
7+
#' The default, \code{NULL}, uses \code{getOption("errors.digits", 1)}.
78
#' Use \code{digits="pdg"} to choose an appropriate number of digits for each
89
#' value according to the Particle Data Group rounding rule (see references).
910
#' @param scientific logical specifying whether the elements should be
@@ -32,14 +33,15 @@
3233
#'
3334
#' @export
3435
format.errors = function(x,
35-
digits = getOption("errors.digits", 1),
36+
digits = NULL,
3637
scientific = FALSE,
3738
notation = getOption("errors.notation", "parenthesis"),
3839
decimals = getOption("errors.decimals", FALSE),
3940
...)
4041
{
4142
stopifnot(notation %in% c("parenthesis", "plus-minus"))
4243

44+
if (is.null(digits)) digits <- getOption("errors.digits", 1)
4345
digits <- if (digits == "pdg") digits_pdg(.e(x)) else rep(digits, length(x))
4446

4547
scipen <- getOption("scipen", 0)

man/format.errors.Rd

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)