1
0
mirror of https://github.com/fumiama/CMoe-Counter.git synced 2025-02-08 23:09:33 +01:00

优化显示长度

This commit is contained in:
源文雨 2022-03-02 18:12:11 +08:00
parent 3aa3ecad26
commit a3136d5c08

7
cmoe.c
View File

@ -118,9 +118,10 @@ static void return_count(char* name, char* theme) {
sprintf(cntstrbuf, "%010u", d->count);
free(spb);
char* cntstr;
for(cntstr = (char*)cntstrbuf; cntstr < (char*)cntstrbuf+10; cntstr++) if(*cntstr != '0') break;
if(cntstr - (char*)cntstrbuf > 2) cntstr -= 2; // 保留 3 位 0
else cntstr = cntstrbuf; // 保留所有 0
for(int i = 0; i < 10; i++) if(cntstrbuf[i] != '0') {
cntstr = cntstrbuf+(i>2)?(i-2):0;
break;
}
int isbig = 0;
char** theme_type = mb;
uint16_t* len_type = mbl;