Skip to content

Commit

Permalink
include % symbol by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe Figueiredo committed May 11, 2018
1 parent 6aec221 commit e909823
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/format.pct.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
format.pct <- function(p, digits = 0) {
format.float(p*100, digits)
format.pct <- function(p, digits = 0, pct.symbol = TRUE) {
symbol <- "%"
if (!pct.symbol) symbol <- NULL
paste0(format.float(p*100, digits), symbol)
}

0 comments on commit e909823

Please sign in to comment.