Is there a fmtlib API to have something similar to std::to_chars
, but also returning a set of string_view for every part of the resulting string - specifically, sign; integer part; decimal part; exponent sign; exponent itself? That could help create own post-processing of e.g. floating-point or integer output, inserting separators (where standard things provided by locale are insufficient) without complexity of parsing the string, and benefit from fast and correct implementation of the library functions.
Thanks!
{fmt} can be used as a replacement for to_chars
but neither provide an API for accessing components of the output. You could look into https://github.com/jk-jeon/dragonbox which is an implementation of one of the FP formatting algorithms used by {fmt} and it might provide a more low-level API that you are looking for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With