-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
As far as I can see the print routine for Long won't display a 0 . I fixed it like this:
void Print(long Value)
{
byte Digits[10];
int long Temp;
byte NumDigits = 0;
/* Is the number negative ? /
if (Value < 0)
{
_WriteChar(13);
Temp = Value * -1;
} else
{
Temp = Value;
}
//Check for 0
if (Value == 0) {
Digits[0] = 0;
NumDigits = 1;
}
/ Store each digit in a byte array so that they
can be printed in reverse order */
while (Temp)
{
Digits[NumDigits] = Temp % 10;
Temp /= 10;
NumDigits++;
}
/* Print each digit */
while (NumDigits)
{
NumDigits--;
_WriteChar(Digits[NumDigits] + 16);
}
}
Metadata
Metadata
Assignees
Labels
No labels