@@ -325,7 +325,7 @@ def _get_numbering_system(locale: Locale, numbering_system: Literal["default"] |
325
325
326
326
327
327
def _get_number_symbols (
328
- locale : Locale | str ,
328
+ locale : Locale | str | None ,
329
329
* ,
330
330
numbering_system : Literal ["default" ] | str = "latn" ,
331
331
) -> LocaleDataDict :
@@ -1275,7 +1275,8 @@ def scientific_notation_elements(
1275
1275
self ,
1276
1276
value : decimal .Decimal ,
1277
1277
locale : Locale | str | None ,
1278
- numbering_system : str ,
1278
+ * ,
1279
+ numbering_system : Literal ["default" ] | str = "latn" ,
1279
1280
) -> tuple [decimal .Decimal , int , str ]:
1280
1281
""" Returns normalized scientific notation components of a value.
1281
1282
"""
@@ -1337,8 +1338,8 @@ def apply(
1337
1338
:type decimal_quantization: bool
1338
1339
:param force_frac: DEPRECATED - a forced override for `self.frac_prec`
1339
1340
for a single formatting invocation.
1340
- :param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn", special
1341
- value "default" will use the default numbering system of the locale.
1341
+ :param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
1342
+ The special value "default" will use the default numbering system of the locale.
1342
1343
:return: Formatted decimal string.
1343
1344
:rtype: str
1344
1345
:raise UnsupportedNumberingSystemError: If the numbering system is not supported by the locale.
@@ -1458,7 +1459,15 @@ def _format_significant(self, value: decimal.Decimal, minimum: int, maximum: int
1458
1459
).rstrip ('.' )
1459
1460
return result
1460
1461
1461
- def _format_int (self , value : str , min : int , max : int , locale : Locale | str | None , numbering_system : str ) -> str :
1462
+ def _format_int (
1463
+ self ,
1464
+ value : str ,
1465
+ min : int ,
1466
+ max : int ,
1467
+ locale : Locale | str | None ,
1468
+ * ,
1469
+ numbering_system : Literal ["default" ] | str ,
1470
+ ) -> str :
1462
1471
width = len (value )
1463
1472
if width < min :
1464
1473
value = '0' * (min - width ) + value
@@ -1475,8 +1484,10 @@ def _quantize_value(
1475
1484
self ,
1476
1485
value : decimal .Decimal ,
1477
1486
locale : Locale | str | None ,
1478
- frac_prec : tuple [int , int ], group_separator : bool ,
1479
- numbering_system : str ,
1487
+ frac_prec : tuple [int , int ],
1488
+ group_separator : bool ,
1489
+ * ,
1490
+ numbering_system : Literal ["default" ] | str ,
1480
1491
) -> str :
1481
1492
# If the number is +/-Infinity, we can't quantize it
1482
1493
if value .is_infinite ():
@@ -1493,9 +1504,10 @@ def _quantize_value(
1493
1504
def _format_frac (
1494
1505
self ,
1495
1506
value : str ,
1496
- numbering_system : str ,
1497
1507
locale : Locale | str | None ,
1498
1508
force_frac : tuple [int , int ] | None = None ,
1509
+ * ,
1510
+ numbering_system : Literal ["default" ] | str ,
1499
1511
) -> str :
1500
1512
min , max = force_frac or self .frac_prec
1501
1513
if len (value ) < min :
0 commit comments