How to set default formatter to never use scientific notation using pretty formatter? #1937
Unanswered
MattTheCuber
asked this question in
Q&A
Replies: 2 comments 2 replies
-
With the new formatter delegate, it is much easier to write your own and swap it. The docs are not ready yet, but you can check the https://github.com/hgrecco/pint/blob/master/pint/delegates/formatter/plain.py and https://pint.readthedocs.io/en/develop/user/formatting.html#custom-formats |
Beta Was this translation helpful? Give feedback.
1 reply
-
for something much simpler than a custom formatter (which do give you a lot of power, but might be overkill here – depends on what you want), you could just use the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using my formatter with
ureg.default_format = "~P"
at the formatter. This works well, but very small numbers are formatted using scientific notation which is not my preference (e.g.3.410605131648481×10⁻¹³ ft/s
should be"0.00000000000034106 ft/s"
).Beta Was this translation helpful? Give feedback.
All reactions