as_formatted_number: Format numeric value for output

Description Usage Arguments Value Examples

View source: R/stringr-like.R

Description

Vectorised conversion

Usage

1
as_formatted_number(x, decimal_places = 1, remove_trailing_zeroes = T)

Arguments

x

Numeric vector

decimal_places

Decimal places to display

remove_trailing_zeroes

If the required decimal places are less than decimal places, should resulting trailing zeros be removed?

Value

Character vector

Examples

1
as_formatted_number(0.74167, 2) # gives "0.74"

tidytidbits documentation built on March 8, 2021, 5:07 p.m.