format_currency: Format currency values with appropriate suffixes

View source: R/formatting_helpers.R

format_currencyR Documentation

Format currency values with appropriate suffixes

Description

Format currency values with appropriate suffixes

Usage

format_currency(val, digits = 2)

Arguments

val

Numeric value to format as currency

digits

Number of digits after decimal for millions/billions (default: 2)

Value

Formatted currency string

Examples

format_currency(1234567)      # "$1.23M"
format_currency(1234567890)   # "$1.23B"
format_currency(123)          # "$123"

sensortowerR documentation built on March 18, 2026, 5:07 p.m.