Skip to content

Commit

Permalink
restore digits option
Browse files Browse the repository at this point in the history
  • Loading branch information
Enchufa2 committed Aug 1, 2024
1 parent 9c808db commit 39b3e59
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion R/print.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#'
#' @param x an \code{errors} object.
#' @param digits how many significant digits are to be used for uncertainties.
#' The default, \code{NULL}, uses \code{getOption("errors.digits", 1)}.
#' Use \code{digits="pdg"} to choose an appropriate number of digits for each
#' value according to the Particle Data Group rounding rule (see references).
#' @param scientific logical specifying whether the elements should be
Expand Down Expand Up @@ -32,14 +33,15 @@
#'
#' @export
format.errors = function(x,
digits = getOption("errors.digits", 1),
digits = NULL,
scientific = FALSE,
notation = getOption("errors.notation", "parenthesis"),
decimals = getOption("errors.decimals", FALSE),
...)
{
stopifnot(notation %in% c("parenthesis", "plus-minus"))

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

scipen <- getOption("scipen", 0)
Expand Down
7 changes: 4 additions & 3 deletions man/format.errors.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 39b3e59

Please sign in to comment.