safe_round: Safe rounding that handles 'NULL' and NA

safe_roundR Documentation

Safe rounding that handles NULL and NA

Description

Rounds numeric values while gracefully handling NULL, empty, and NA inputs.

Usage

safe_round(x, digits)

Arguments

x

Numeric value to round.

digits

Integer number of decimal places.

Value

Rounded numeric value, or NA_real_ if input is NULL/NA/empty.


summata documentation built on May 7, 2026, 5:07 p.m.