hide sign if only positive values

This commit is contained in:
Pusillus
2019-10-08 06:25:40 +02:00
committed by GitHub
parent dbccceea51
commit 99fd136758

View File

@@ -381,20 +381,19 @@ static void lv_spinbox_updatevalue(lv_obj_t * spinbox)
char buf[LV_SPINBOX_MAX_DIGIT_COUNT + 8];
memset(buf, 0, sizeof(buf));
char* buf_p = buf;
int i;
char * buf_p = buf;
if (ext->range_min < 0) { // hide sign if there are only positive values
/*Add the sign*/
(*buf_p) = ext->value >= 0 ? '+' : '-';
buf_p++;
}
/*padding left*/
for (i = 0; i < ext->digit_padding_left; i++) {
(*buf_p) = ' ';
buf_p++;
}
int i;
/*padding left*/
for(i = 0; i < ext->digit_padding_left; i++) {
(*buf_p) = ' ';
buf_p++;
}
char digits[64];