round2: Standard rounding rather than R's round function which uses...

View source: R/round2.R

round2R Documentation

Standard rounding rather than R's round function which uses bankers rounding

Description

Standard rounding rather than R's round function which uses bankers rounding

Usage

round2(x, n)

Arguments

x

Number to be rounded

n

Decimal places to be rounded to

Value

The number rounded to the nearest integer where .5 is always rounded up

Examples

x <- 2.3
n <- 0
round2(x, n)

x <- 1.85
n <- 1
round2(x, n)

x <- 10.988
n <- 2
round2(x, n) 

Tychobra/tychobratools documentation built on April 12, 2022, 12:29 a.m.