support more padding char

This commit is contained in:
BLUELOVETH 2023-08-25 17:22:03 +08:00
parent 6e86375f9b
commit d3d07d060c

View File

@ -397,9 +397,12 @@ PyObject* VM::format(Str spec, PyObject* obj){
} }
char pad_c = ' '; char pad_c = ' ';
if(spec[0] == '0'){ for(char c: std::string_view("0-=*#@!~")){
pad_c = '0'; if(spec[0] == c){
pad_c = c;
spec = spec.substr(1); spec = spec.substr(1);
break;
}
} }
char align; char align;
if(spec[0] == '>'){ if(spec[0] == '>'){