fmt::group_digits

Returns a view that formats an integer value using ',' as a locale-independent thousands separator.

Synopsis

Declared in <fmt/format.h>

template<typename T>
group_digits_view<T>
group_digits(T value);

Description

Example:

fmt::print("{}", fmt::group_digits(12345)); // Output: "12,345"

Return Value

A view that formats value with ',' thousands separators.

Parameters

NameDescription
valueThe integer value to format with grouped digits.