round_half_away_from_zero: Round Half Away From Zero

View source: R/round_half_away_from_zero.R

round_half_away_from_zeroR Documentation

Round Half Away From Zero

Description

Commercial rounding is done a lot, especially with invoices. There is even standard 1333 by the German Institute for Standardization. round rounds half to even, see round's Details section.

round_commercially is just a link to round_half_away_from_zero.

Usage

round_half_away_from_zero(x, digits = 0)

round_commercially(x, digits = 0)

Arguments

x

A number to be rounded.

digits

The number of digits, as in round.

Value

The rounded number.

See Also

Other statistics: column_sums(), count_groups(), relative_difference(), sloboda(), weighted_variance()

Examples

x <- 22.5
round_half_away_from_zero(x)
round(x)
round_half_away_from_zero(-x)
round(-x)

fritools documentation built on Nov. 19, 2023, 1:06 a.m.