@@ -1330,14 +1330,14 @@ def format_year(self, char, num):
1330
1330
def format_quarter (self , char , num ):
1331
1331
quarter = (self .value .month - 1 ) // 3 + 1
1332
1332
if num <= 2 :
1333
- return ( '%%0%dd ' % num ) % quarter
1333
+ return '%0*d ' % ( num , quarter )
1334
1334
width = {3 : 'abbreviated' , 4 : 'wide' , 5 : 'narrow' }[num ]
1335
1335
context = {'Q' : 'format' , 'q' : 'stand-alone' }[char ]
1336
1336
return get_quarter_names (width , context , self .locale )[quarter ]
1337
1337
1338
1338
def format_month (self , char , num ):
1339
1339
if num <= 2 :
1340
- return ( '%%0%dd ' % num ) % self .value .month
1340
+ return '%0*d ' % ( num , self .value .month )
1341
1341
width = {3 : 'abbreviated' , 4 : 'wide' , 5 : 'narrow' }[num ]
1342
1342
context = {'M' : 'format' , 'L' : 'stand-alone' }[char ]
1343
1343
return get_month_names (width , context , self .locale )[self .value .month ]
@@ -1470,7 +1470,7 @@ def format_timezone(self, char, num):
1470
1470
return get_timezone_gmt (self .value , width = 'iso8601' , locale = self .locale )
1471
1471
1472
1472
def format (self , value , length ):
1473
- return ( '%%0%dd ' % length ) % value
1473
+ return '%0*d ' % ( length , value )
1474
1474
1475
1475
def get_day_of_year (self , date = None ):
1476
1476
if date is None :
0 commit comments