Learn R Programming

faraway (version 1.0.8)

fround: Formating the Rounding of Numbers

Description

fround rounds the values in its first argument to the specified number of decimal places with surrounding quotes.

Usage

fround(x, digits)

Arguments

x

a numeric vector.

digits

integer indicating the precision to be used.

Author

Andrew Gelman; Yu-Sung Su

Details

pfround rounds the values in its first argument to the specified number of decimal places without surrounding quotes.

References

Copied from the arm package

See Also

Examples

Run this code

    x <- 3.1415926
    fround(x, digits=2)
    pfround(x, digits=2)

Run the code above in your browser using DataLab