As far as I understand, the default formatting option should produce the shortest output, not just in the number of significand digits, but also in the number of actual characters. At least that seems to be how std::format
is specified, according to the std::to_chars
specifications.
However, it seems currently fmt
picks the fixed-point format whenever the exponent is between -4
and 16
, regardless of the number of characters it will produce:
Is this an intended divergence? Or maybe I misunderstood how std::format
is specified?
For what it's worth, it seems MS STL implementation of std::format
does what I described.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4