Skip to content

Commit

Permalink
show + if positive
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzwalthert committed Oct 25, 2020
1 parent 15480be commit 6535ba1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bench/01-declarations.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ plot_against_base <- function(new_bm,
new_bm <- dplyr::bind_rows(reference, new_bm)
stopifnot(nrow(new_bm) == 2)
diff_in_percent <- round(100 * diff(new_bm$p50) / new_bm$p50[1])
diff_in_percent <- ifelse(diff_in_percent > 0,
paste0("+", diff_in_percent),
diff_in_percent
)
pr_comment <- glue::glue("* {name}: {round(new_bm$p50[1], 3)} -> {round(new_bm$p50[2], 3)} ({diff_in_percent}%)")
cat(pr_comment, file = "pr-comment/info.txt", sep = "\n", append = TRUE)
}
Expand Down

0 comments on commit 6535ba1

Please sign in to comment.