Skip to content

Commit 07267a1

Browse files
Very rough FORMAT_MIN_WIDTH implementation
1 parent 18b5997 commit 07267a1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cores/arduino/Print.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ size_t Formatters::DefaultFormatter::printNumber(Print *p , unsigned long n) con
9999
*--str = c < 10 ? c + '0' : c + 'A' - 10;
100100
} while(n);
101101

102+
while (str > buf && buf + sizeof(buf) - 1 - str < this->min_width)
103+
*--str = '0';
104+
102105
return p->write(str);
103106
}
104107

0 commit comments

Comments
 (0)