xieite::str_num()

Defined in header <xieite/math/str_num.hpp>

Stringifies numbers. Allows negative radices.


Declaration

template<xieite::is_arith T>
[[nodiscard]] constexpr std::string str_num(T n, std::conditional_t<std::floating_point<T>, xieite::ssize_t, T> radix = 10, xieite::num_str_config cfg = {}, std::size_t pad = 0) noexcept;


Example

int main() {
	xieite::dump(xieite::str_num(12345));
}
Output:
12345
[View in Compiler Explorer]