Skip to contents

A function to implement the Excel method of rounding.

Usage

construct_round_excel(x, n = 0)

Arguments

x

Value or values to round

n

Number of significant digits

Value

A rounded value or vector of values

Details

Given a decimal, the function will round the value to the specified number of decimal places using the Excel method of rounding (rounding up from .5).

Examples

construct_round_excel(c(1.6, 5.9, 2.5), 0)
#> [1] 2 6 3