round2: Round to the Nearest Number

View source: R/round2.R

round2R Documentation

Round to the Nearest Number

Description

Round to the nearest number with the number of digits as indicated. NOTE: Unlike the base round function it rounds a 5 to the higher number, rather than the nearest even number.

Usage

round2(x, digits = 0)

Arguments

x

number to be rounded

digits

number of digits to round to

Value

Number rounded to the number of digits indicated

Examples

round2(2.5)

smallstuff documentation built on June 2, 2022, 5:06 p.m.