1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 09:51:48 +02:00

(v1.6.0.9052) unit tests

This commit is contained in:
2021-05-20 11:42:39 +02:00
parent d1b1828ab8
commit 4a2a48b7c1
16 changed files with 29 additions and 25 deletions

View File

@ -1150,6 +1150,9 @@ percentage <- function(x, digits = NULL, ...) {
if (is.null(digits)) {
digits <- getdecimalplaces(x)
}
if (is.null(digits) || is.na(digits) || !is.numeric(digits)) {
digits <- 2
}
# round right: percentage(0.4455) and format(as.percentage(0.4455), 1) should return "44.6%", not "44.5%"
x_formatted <- format(round2(as.double(x), digits = digits + 2) * 100,