round2: Round a given number, with 5 always rounded up

Description Usage Arguments Details

Description

Given a number and a digit to round to, returns the rounded number, with 5 always rounded upwards.

Usage

1
round2(x, n)

Arguments

x

the data to be rounded

n

the number of digits to round to

Details

This function differs from round, which rounds 5 "towards the even number". Rounding 5s up leads to bias when positive and negative numbers are expected, but can be desired in some cases.


rubias documentation built on Feb. 10, 2022, 1:06 a.m.