mpaland / printf

Tiny, fast, non-dependent and fully loaded printf implementation for embedded systems. Extensive test suite passing.
MIT License
2.47k stars 452 forks source link

More cases of "%g" not falling back to decimal mode #122

Open eyalroz opened 2 years ago

eyalroz commented 2 years ago

If we printf_("%#.1g", -40661.5), we currently get -40662, but should be getting -4.e+04 : With "%g", the "precision" value means the number of significant digits to show; and if the number isn't fully captured by those, we are supposed to use exponential notation.