From 0961daacaa771bcefe0c4cdc1127662b992ac446 Mon Sep 17 00:00:00 2001 From: wuyangfan <1102042793@qq.com> Date: Sun, 17 May 2026 22:25:01 +0800 Subject: [PATCH] docs: note std::format hex float 0x prefix difference Document that fmt's 'a'/'A' presentation adds a 0x/0X prefix while std::format (via std::to_chars) does not. Closes #4657. --- doc/api.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api.md b/doc/api.md index ff190383..376e9d87 100644 --- a/doc/api.md +++ b/doc/api.md @@ -715,6 +715,10 @@ following differences: (ignoring redundant digits and sign in exponent) and may produce more decimal digits than necessary. +- For the hexadecimal floating-point presentation types (`'a'`/`'A'`), + {fmt} includes a `0x`/`0X` prefix (similar to `printf`'s `%a`), while + `std::format` follows `std::to_chars` and omits the prefix. + ## Configuration Options {fmt} provides configuration via CMake options and preprocessor macros to