Merge pull request #977 from OskarLinde/Marlin_v1
Fix lcd itostr3() to handle negative numbers
This commit is contained in:
commit
dde61d8886
1 changed files with 6 additions and 2 deletions
|
@ -1496,9 +1496,13 @@ char *itostr31(const int &xx)
|
|||
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';
|
||||
else
|
||||
conv[0]=' ';
|
||||
|
|
Reference in a new issue