as_formatted_number {tidytidbits}R Documentation

Format numeric value for output

Description

Vectorised conversion

Usage

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

as_formatted_number(0.74167, 2) # gives "0.74"

[Package tidytidbits version 0.3.2 Index]