8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e01393 commit 8e17289Copy full SHA for 8e17289
lib/matplotlib/ticker.py
@@ -1268,7 +1268,8 @@ def format_eng(self, num):
1268
# Taking care of the cases like 999.9..., which may be rounded to 1000
1269
# instead of 1 k. Beware of the corner case of values that are beyond
1270
# the range of SI prefixes (i.e. > 'Y').
1271
- if float(format(mant, fmt)) >= 1000 and pow10 < max(self.ENG_PREFIXES):
+ _fmant = float(format(mant, fmt))
1272
+ if (_fmant >= 1000 or _fmant <= -1000) and pow10 < max(self.ENG_PREFIXES):
1273
mant /= 1000
1274
pow10 += 3
1275
0 commit comments