Learn R Programming

broman (version 0.59-5)

myround: 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.

Value

  • A vector of character strings.

Details

Uses sprintf to round a number, keeping extra 0's.

See Also

round, sprintf

Examples

Run this code
myround(51.01, 3)
myround(0.199, 2)

Run the code above in your browser using DataLab