View source: R/format_percent.R
format_percent | R Documentation |
Specifically, a percent based on a proportion that cannot exceed 1. Round
and format all values to the specified digits using the
scales::percent
function, but replace outputs like 100.0%" and
"100.00%" with "100%".
format_percent(percent, digits = 0.1)
percent |
The percentage to be rounded, as a decimal (e.g. 0.95 for 95%). |
digits |
The number of digits to round to. Defaults to |
A formatted percent.
format_percent(0.95)
format_percent(0.9521231251, 0.0001)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.