@@ -1083,7 +1083,7 @@ mp_obj_t mp_obj_str_format(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwa
10831083 if (arg_looks_integer (arg )) {
10841084 switch (type ) {
10851085 case 'b' :
1086- pfenv_print_mp_int (& pfenv_vstr , arg , 1 , 2 , 'a' , flags , fill , width , 0 );
1086+ pfenv_print_mp_int (& pfenv_vstr , arg , 2 , 'a' , flags , fill , width , 0 );
10871087 continue ;
10881088
10891089 case 'c' :
@@ -1096,20 +1096,20 @@ mp_obj_t mp_obj_str_format(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwa
10961096 case '\0' : // No explicit format type implies 'd'
10971097 case 'n' : // I don't think we support locales in uPy so use 'd'
10981098 case 'd' :
1099- pfenv_print_mp_int (& pfenv_vstr , arg , 1 , 10 , 'a' , flags , fill , width , 0 );
1099+ pfenv_print_mp_int (& pfenv_vstr , arg , 10 , 'a' , flags , fill , width , 0 );
11001100 continue ;
11011101
11021102 case 'o' :
11031103 if (flags & PF_FLAG_SHOW_PREFIX ) {
11041104 flags |= PF_FLAG_SHOW_OCTAL_LETTER ;
11051105 }
11061106
1107- pfenv_print_mp_int (& pfenv_vstr , arg , 1 , 8 , 'a' , flags , fill , width , 0 );
1107+ pfenv_print_mp_int (& pfenv_vstr , arg , 8 , 'a' , flags , fill , width , 0 );
11081108 continue ;
11091109
11101110 case 'X' :
11111111 case 'x' :
1112- pfenv_print_mp_int (& pfenv_vstr , arg , 1 , 16 , type - ('X' - 'A' ), flags , fill , width , 0 );
1112+ pfenv_print_mp_int (& pfenv_vstr , arg , 16 , type - ('X' - 'A' ), flags , fill , width , 0 );
11131113 continue ;
11141114
11151115 case 'e' :
@@ -1377,7 +1377,7 @@ STATIC mp_obj_t str_modulo_format(mp_obj_t pattern, mp_uint_t n_args, const mp_o
13771377 case 'd' :
13781378 case 'i' :
13791379 case 'u' :
1380- pfenv_print_mp_int (& pfenv_vstr , arg_as_int (arg ), 1 , 10 , 'a' , flags , fill , width , prec );
1380+ pfenv_print_mp_int (& pfenv_vstr , arg_as_int (arg ), 10 , 'a' , flags , fill , width , prec );
13811381 break ;
13821382
13831383#if MICROPY_PY_BUILTINS_FLOAT
@@ -1395,7 +1395,7 @@ STATIC mp_obj_t str_modulo_format(mp_obj_t pattern, mp_uint_t n_args, const mp_o
13951395 if (alt ) {
13961396 flags |= (PF_FLAG_SHOW_PREFIX | PF_FLAG_SHOW_OCTAL_LETTER );
13971397 }
1398- pfenv_print_mp_int (& pfenv_vstr , arg , 1 , 8 , 'a' , flags , fill , width , prec );
1398+ pfenv_print_mp_int (& pfenv_vstr , arg , 8 , 'a' , flags , fill , width , prec );
13991399 break ;
14001400
14011401 case 'r' :
@@ -1419,7 +1419,7 @@ STATIC mp_obj_t str_modulo_format(mp_obj_t pattern, mp_uint_t n_args, const mp_o
14191419
14201420 case 'X' :
14211421 case 'x' :
1422- pfenv_print_mp_int (& pfenv_vstr , arg , 1 , 16 , * str - ('X' - 'A' ), flags | alt , fill , width , prec );
1422+ pfenv_print_mp_int (& pfenv_vstr , arg , 16 , * str - ('X' - 'A' ), flags | alt , fill , width , prec );
14231423 break ;
14241424
14251425 default :
0 commit comments