format_number: Format numeric value with fixed decimal places

View source: R/forest_utils.R

format_numberR Documentation

Format numeric value with fixed decimal places

Description

Formats a numeric value to a specified number of decimal places, removing leading/trailing whitespace and fixing negative zero display (e.g., "-0.00" becomes "0.00"). When marks is supplied, applies locale-appropriate decimal mark substitution.

Usage

format_number(x, digits, marks = NULL)

Arguments

x

Numeric value to format.

digits

Integer number of decimal places.

marks

Optional list with big.mark and decimal.mark as returned by resolve_number_marks.

Value

Character string with formatted value.


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