Skip to content

Commit 1c197bc

Browse files
authored
Merge pull request #162 from jdblischak/spendfn-multiparameter
Improve text summary of spending functions with multiple parameters
2 parents e266fcf + 1a70a49 commit 1c197bc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

R/gsMethods.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,11 @@ summary.spendfn <- function(object, ...) {
820820
else {
821821
s <- paste(object$name, "spending function")
822822
if (!is.null(object$parname) && !is.null(object$param)) {
823-
s <- paste(s, "with", paste(object$parname, collapse = " "), "=", paste(object$param, collapse = " "))
823+
# Use %s for the numeric object$param in order to preserve the decimal
824+
# places entered by the user
825+
params <- sprintf("%s = %s", object$parname, round(object$param, digits = 5))
826+
params <- paste(params, collapse = ", ")
827+
s <- paste(s, "with", params)
824828
}
825829
}
826830
return(s)

0 commit comments

Comments
 (0)