print_: Printing currency values or percentages

print_currencyR Documentation

Description

Wrapper functions for printing nicely formatted values.

Usage

print_currency(
  x,
  suffix = "",
  big.mark = ",",
  accuracy = NULL,
  prefix = NULL,
  ...
)

print_percent(x, accuracy = 0.1, ...)

Arguments

x

A numeric vector

big.mark

Character used between every 3 digits to separate thousands.

accuracy

A number to round to. Use (e.g.) 0.01 to show 2 decimal places of precision. If NULL, the default, uses a heuristic that should ensure breaks have the minimum number of digits needed to show the difference between adjacent values.

Applied to rescaled data.

prefix, suffix

Symbols to display before and after value.

...

Other arguments passed on to base::format().

Value

A character. Formatted value.

A character. Formatted value.

See Also

scales::dollar()

scales::percent()

Examples

print_currency(2345678, suffix = " PLN")
print_percent(0.52366)

R4GoodPersonalFinances documentation built on April 4, 2025, 1:48 a.m.