# Basic number formatting with thousands separators
number_format("population")
# Currency formatting
number_format("income", style = "currency", currency = "USD")
# Percentage with 1 decimal place
number_format("rate", style = "percent", maximum_fraction_digits = 1)
# Compact notation for large numbers
number_format("population", notation = "compact")
# Using within a tooltip
concat("Population: ", number_format("population", notation = "compact"))
# Using with get_column()
number_format(get_column("value"), style = "currency", currency = "EUR")
Run the code above in your browser using DataLab