8000 Support grouping in Tick formatter based on locale. · matplotlib/matplotlib@6d3de0c · GitHub
[go: up one dir, main page]

Skip to content

Commit 6d3de0c

Browse files
z0rgyQuLogic
authored andcommitted
Support grouping in Tick formatter based on locale.
When formatting and setting useLocale to True, the numbers greater than 1000 are not grouped as specified by the locale. 1000 should be 1,000 in certain locales. By setting the last argument to locale.format_string the locale dependent grouping is honored.
1 parent 855e3bb commit 6d3de0c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/ticker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ def __call__(self, x, pos=None):
647647
if abs(xp) < 1e-8:
648648
xp = 0
649649
if self._useLocale:
650-
s = locale.format_string(self.format, (xp,))
650+
s = locale.format_string(self.format, (xp,), True)
651651
else:
652652
s = self.format % xp
653653
return self.fix_minus(s)

0 commit comments

Comments
 (0)
0