round2: Round while keeping trailing zeroes

Description Usage Arguments Examples

View source: R/functions.R

Description

Rounds a numeric value and formats it as a string, keeping trailing zeroes.

Usage

1
round2(x, digits = 2)

Arguments

x

Numeric value to round

digits

Digits for rounding

Examples

1
2
3
4
round2(0.03000, digits = 4)

# compare to base round, which drops trailing zeroes and returns a numeric
round(0.03000, digits = 4)

MetaUtility documentation built on Oct. 30, 2021, 5:07 p.m.