format_num: Format a numeric value with locale-aware separators

View source: R/number_utils.R

format_numR Documentation

Format a numeric value with locale-aware separators

Description

General-purpose number formatter used by all display functions. For values \ge 1000 (in absolute value), inserts the appropriate thousands separator. Fixes negative-zero display artefacts.

Usage

format_num(x, fmt_str, marks)

Arguments

x

Numeric value to format.

fmt_str

Character string sprintf format specification (e.g., "%.1f"). Used only for |x| < 1000.

marks

List with big.mark and decimal.mark as returned by resolve_number_marks.

Value

Character string with the formatted number.


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