3 ms·
It reminds me that it's annoying that there is no "engineering" mode for printf (to force the exponent to be a multiple of three). There is this project on git
by jhallenworld 11y ago
It reminds me that it's annoying that there is no "engineering" mode for printf (to force the exponent to be a multiple of three). There is this project on github using %.*f: https://github.com/dhoerl/EngineeringNotationFormatter https://github.com/dhoerl/EngineeringNotationFormatter
- montecarl 11y agoI have always wished that printf (or its equivalent in your language) was somehow extensible. In a language like Python you can kind of get around this by defining __str__ on an object an using %s to format it, but that doesn't help implement something like engineering mode.