Skip to content

Commit 2dc6307

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 2486ba2 commit 2dc6307

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
@@ -612,7 +612,7 @@ def _format_maybe_minus_and_locale(self, fmt, arg):
612612
"""
613613
Format *arg* with *fmt*, applying unicode minus and locale if desired.
614614
"""
615-
return self.fix_minus(locale.format_string(fmt, (arg,))
615+
return self.fix_minus(locale.format_string(fmt, (arg,), True)
616616
if self._useLocale else fmt % arg)
617617

618618
def get_useMathText(self):

0 commit comments

Comments
 (0)