You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C/C++, Python, and Java all support the %g formatting specifier, which effectively selects between %e and %f as appropriate. I was surprised to learn that Rust does not.
If this library is trying to stay close to Rust std::fmt, I wouldn't change the implementation, but please provide some guidance in the documentation for those of us who are used to specifying %g. (either we can't do it, or we should consider a workaround = ???)
The text was updated successfully, but these errors were encountered:
If I understood correctly, you can work around it by using oxifmt's strfmt to format your number with both scientific and decimal formats, retaining only the formatted string with the shortest length. (This can be encapsulated in a function for ease of use.) You'd then substitute the result into your larger string with another call to oxifmt's strfmt.
We could consider having this built into oxifmt at some point once I think of a proper design for "extensions".
C/C++, Python, and Java all support the
%g
formatting specifier, which effectively selects between%e
and%f
as appropriate. I was surprised to learn that Rust does not.If this library is trying to stay close to Rust
std::fmt
, I wouldn't change the implementation, but please provide some guidance in the documentation for those of us who are used to specifying%g
. (either we can't do it, or we should consider a workaround = ???)The text was updated successfully, but these errors were encountered: