Skip to contents

Formats numeric values as percentages with journal conventions and 0 decimal places.

Formats numeric values as percentages with journal conventions and 1 decimal place.

Formats numeric values as percentages with journal conventions and 2 decimal places.

Usage

format_num_as_journal_perc_0(x)

format_num_as_journal_perc_1(x)

format_num_as_journal_perc_2(x)

Arguments

x

Numeric vector to format.

Value

Character vector of journal-formatted numbers with a "

Character vector of journal-formatted numbers with a "

Character vector of journal-formatted numbers with a "

Examples

# Format percentages
format_num_as_journal_perc_0(c(12.34, 56.78, NA))
#> [1] "12%" "57%" "NA" 
format_num_as_journal_perc_1(c(12.34, 56.78, NA))  
#> [1] "12.3%" "56.8%" "NA"   
format_num_as_journal_perc_2(c(12.34, 56.78, NA))
#> [1] "12.34%" "56.78%" "NA"