rounded: Round a number

View source: R/dbRake.R

roundedR Documentation

Round a number

Description

For some reason, R rounds to even (i.e., 12.5 rounds to 12), but we want to round to 0 (i.e., 12.5 rounds to 13). This is a helper function used in dbRake.

Usage

rounded(x)

Arguments

x

Number to be rounded

Value

Rounded number

Author(s)

Stephanie Yurchak, BC Stats

See Also

The overall raking function: dbRake()

Other raking helpers: add.random.fraction.to.cols(), adjustSex(), allowNegsnoMargin(), calc.cols(), multiRake(), noNegsneedMargin(), noNegsnoMargin(), prep.prorate.col(), prorate.col(), prorate.row(), prorate(), read.inputs(), real.to.int(), rename.age.grps()

Examples

rounded(1.2345)  ## 1
rounded(12.5)    ## 13

bcgov/dbutils documentation built on Sept. 30, 2022, 12:04 a.m.