round_to_nearest_digit: Round To Nearest Digit

View source: R/rounding.R

round_to_nearest_digitR Documentation

Round To Nearest Digit

Description

A function that does symmetric rounding to the nearest digits.

Usage

round_to_nearest_digit(number, digits = 0)

Arguments

number

Input numeric value

digits

Input integer indicating the number of decimal places to be used. By default, it symmetrically rounds off to the nearest integer. Default: 0

Examples

round_to_nearest_digit(0.5)
round_to_nearest_digit(1.5)
round_to_nearest_digit(-0.5)
round_to_nearest_digit(-1.5)

RiskScorescvd documentation built on June 27, 2024, 5:13 p.m.