Skip to content

Commit

Permalink
Merge pull request #162 from jdblischak/spendfn-multiparameter
Browse files Browse the repository at this point in the history
Improve text summary of spending functions with multiple parameters
  • Loading branch information
keaven authored Jul 26, 2024
2 parents e266fcf + 1a70a49 commit 1c197bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/gsMethods.R
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,11 @@ summary.spendfn <- function(object, ...) {
else {
s <- paste(object$name, "spending function")
if (!is.null(object$parname) && !is.null(object$param)) {
s <- paste(s, "with", paste(object$parname, collapse = " "), "=", paste(object$param, collapse = " "))
# Use %s for the numeric object$param in order to preserve the decimal
# places entered by the user
params <- sprintf("%s = %s", object$parname, round(object$param, digits = 5))
params <- paste(params, collapse = ", ")
s <- paste(s, "with", params)
}
}
return(s)
Expand Down

0 comments on commit 1c197bc

Please sign in to comment.