RPNX::QueryGraph
Typed, memoized, concurrent query evaluation for C++23
Loading...
Searching...
No Matches
byte_format.hpp File Reference

Human-readable formatting utilities used by QueryGraph diagnostics. More...

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <iomanip>
#include <sstream>
#include <string>

Go to the source code of this file.

Functions

std::string rpnx::querygraph::format_iec_bytes (std::size_t bytes)
 Format a byte count using IEC binary units.
 

Detailed Description

Human-readable formatting utilities used by QueryGraph diagnostics.

Definition in file byte_format.hpp.

Function Documentation

◆ format_iec_bytes()

std::string rpnx::querygraph::format_iec_bytes ( std::size_t bytes)
inline

Format a byte count using IEC binary units.

The result uses B, KiB, MiB, and larger IEC suffixes. Values above one byte are rounded to approximately three significant decimal digits; byte values themselves are emitted without a fractional part.

Parameters
bytesNumber of bytes to format.
Returns
A compact value such as 0B, 512B, 1.50KiB, or 2.00MiB.

Definition at line 28 of file byte_format.hpp.