myround: Round a number, preserving extra 0's

View source: R/myround.R

myroundR Documentation

Round a number, preserving extra 0's

Description

Round a number, preserving extra 0's.

Usage

myround(x, digits = 1)

Arguments

x

Number to round.

digits

Number of digits past the decimal point to keep.

Details

Uses base::sprintf() to round a number, keeping extra 0's.

Value

A vector of character strings.

See Also

base::round(), base::sprintf()

Examples

myround(51.01, 3)
myround(0.199, 2)


broman documentation built on May 29, 2024, 7:18 a.m.

Related to myround in broman...