format_currency: Formats a number into a currency string

View source: R/string_tools.R

format_currencyR Documentation

Formats a number into a currency string

Description

Formats a number into a currency string

Usage

format_currency(amount, currency = c("EUR", "GBP"),
  number_decimals = 2, scale = c("normal", "k", "M"))

Arguments

amount

The number you want to format as euros

currency

The currency symbol that should be used as a prefix

number_decimals

The largest number that should still be formatted using cents

scale

Used when you want to format the number in scales (regular, per thousands or millions)

Value

A string containing the euro formatted number

Examples

format_currency(amount = 1000000, currency = "EUR", number_decimals = 1,scale = "M")

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