roundN: Function for Rounding with 'round2'

View source: R/other_functions.R

roundNR Documentation

Function for Rounding with round2

Description

This function simplifies and specializes the round2 function in exam package. Function rounds the given number to the decimal points specified in argument digits.

Usage

roundN(x, digits)

Arguments

x

numeric. A numeric vector.

digits

numeric. Rounding digits.

Details

The function round2 does what is known in German as kaufmaennisches Runden (rounding away from zero for trailing 5s).

Value

Numeric value or vector.

Author(s)

Omer Kara

References

For more information see round2.

See Also

round2

Examples

roundN(2.67896, digits = 0)
roundN(2.67896, digits = 1)
roundN(2.67896, digits = 2)
roundN(2.67896, digits = 3)
roundN(2.67896, digits = 4)


omerkara/okara documentation built on Nov. 21, 2023, 7:56 p.m.