FormatAsPercent: Converts a proportion to a percent

View source: R/number.R

FormatAsPercentR Documentation

Converts a proportion to a percent

Description

Converts a proportion to a percent

Usage

FormatAsPercent(
  x,
  digits = 2,
  decimals = NULL,
  remove.leading.0 = FALSE,
  comma.for.thousands = TRUE,
  pad = FALSE,
  show.sign = TRUE
)

Arguments

x

The number(s)

digits

Number of significant digits.

decimals

Number of decimal places to show. If null, this is ignored.

remove.leading.0

Removes the initial 0 from numbers that are less than 1.

comma.for.thousands

If TRUE, uses a comma when there are thousands.

pad

If a vector is supplied and decimals is specified, adds spaces to the beginning of numbers so they become decimal aligned.

show.sign

Logical; whether to show percentage sign

Details

Multiplies by 100, keeping digits or more significant digits and putting a


Displayr/flipFormat documentation built on Aug. 28, 2024, 6:48 p.m.