File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 11import locale
22
3- locale .setlocale (locale .LC_ALL , "" )
4-
53
64def fmt (value : int | float , decimals : int = 1 ) -> str :
75 return locale .format_string (f'%.{ decimals } f' , value , grouping = True )
Original file line number Diff line number Diff line change 22
33import argparse
44import importlib .util
5+ import locale
56import os
67import selectors
78import socket
@@ -634,6 +635,16 @@ def _validate_args(args, parser):
634635
635636def main ():
636637 """Main entry point for the CLI."""
638+ # Set locale for number formatting, restore on exit
639+ old_locale = locale .setlocale (locale .LC_ALL , None )
640+ locale .setlocale (locale .LC_ALL , "" )
641+ try :
642+ _main ()
643+ finally :
644+ locale .setlocale (locale .LC_ALL , old_locale )
645+
646+
647+ def _main ():
637648 # Create the main parser
638649 parser = argparse .ArgumentParser (
639650 description = _HELP_DESCRIPTION ,
You can’t perform that action at this time.
0 commit comments