Skip to content

Commit

Permalink
add approximate sign when not exact for SI prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
emitanaka committed Oct 15, 2023
1 parent e00a732 commit 5b1ec62
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ number_si_prefix <- function(x) {
index <- max(which(n/prefix >= 1))
scale <- 1 / prefix[index]
symbol <- names(prefix)[index]
paste0(floor(n * scale), symbol)
nn <- round(n * scale)
ifelse(nn == n * scale, paste0(nn, symbol), paste0("~", nn, symbol))
})
}

Expand Down

0 comments on commit 5b1ec62

Please sign in to comment.