format_percent: Formats a number to percentage by adding "." for thousands,...

View source: R/string_tools.R

format_percentR Documentation

Formats a number to percentage by adding "." for thousands, "," for decimals and "%" to the number

Description

Formats a number to percentage by adding "." for thousands, "," for decimals and "%" to the number

Usage

format_percent(percentage, number_decimals = 1, format_EN = FALSE)

Arguments

percentage

The number you want to format

number_decimals

The number of decimal places you want shown. Default is 1

format_EN

Indicate whether the formatting should be done UK style. Default is FALSE

Value

A string containing the formatted number

Examples

format_percent(percentage = 0.123, number_decimals = 1, format_EN = TRUE)

mark-me/graydon.package documentation built on Nov. 14, 2023, 5:31 p.m.