Learn R Programming

MetaUtility (version 2.1.2)

round2: Round while keeping trailing zeroes

Description

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

Usage

round2(x, digits = 2)

Arguments

x

Numeric value to round

digits

Digits for rounding

Examples

Run this code
# NOT RUN {
round2(0.03000, digits = 4)

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

Run the code above in your browser using DataLab