pretty_round: Function to return numbers rounded for presentation purposes,...

View source: R/pretty_round.R

pretty_roundR Documentation

Function to return numbers rounded for presentation purposes, with commas where appropriate.

Description

Function to return numbers rounded for presentation purposes, with commas where appropriate.

Usage

pretty_round(x)

Arguments

x

Numeric vector to round

Value

Character vector of rounded numbers, with commas separating thousands and 'm' to denote millions.

Numbers below 1m are rounded to the nearest 100. Numbers >= 1m are rounded to the nearest 1,000.

Examples

pretty_round(c(10, 110, 10050, 20500, 2000100, 3445123))

djpr-data/djprlabourdash documentation built on April 28, 2023, 6:16 p.m.