round_: Round function that returns trailing zeroes

View source: R/formatters.R

round_R Documentation

Round function that returns trailing zeroes

Description

Particularly when creating tables, it is often desirable to keep all numbers to the same width. round() and similar functions drop trailing zeros - this version keeps them and thus rounds 1.201 to 1.20 rather than 1.2 when 2 digits are requested.

Usage

round_(x, digits = 2)

Arguments

x

Numeric vector to be rounded

digits

Number of significant digits

Value

Character vector of rounded values, with trailing zeroes as needed to show digits figures after the decimal point


LukasWallrich/timesaveR documentation built on Nov. 29, 2024, 4:47 a.m.