Fix lcd itostr3() to handle negative numbers
This commit is contained in:
parent
1875ab3bd7
commit
269a068032
@ -1489,9 +1489,13 @@ char *itostr31(const int &xx)
|
|||||||
return conv;
|
return conv;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *itostr3(const int &xx)
|
char *itostr3(const int &x)
|
||||||
{
|
{
|
||||||
if (xx >= 100)
|
int xx = x;
|
||||||
|
if (xx < 0) {
|
||||||
|
conv[0]='-';
|
||||||
|
xx = -xx;
|
||||||
|
} else if (xx >= 100)
|
||||||
conv[0]=(xx/100)%10+'0';
|
conv[0]=(xx/100)%10+'0';
|
||||||
else
|
else
|
||||||
conv[0]=' ';
|
conv[0]=' ';
|
||||||
|
Loading…
Reference in New Issue
Block a user