Page 1 of 1

%string formatting on decimal zero bug

Posted: Tue Mar 14, 2017 6:40 am
by evbaarle
While porting a CPYTHON program to Micropython I noticed this difference:

MicroPython v1.8.6-273-g5efd650 on 2016-12-31; PYBLITEv1.0 with STM32F411RE
Type "help()" for more information.
>>> '%+02d'% (0)
'00'

Cpython will respond with '+0'
{} formatting shows the same error.

Regards, Erik

Re: %string formatting on decimal zero bug

Posted: Tue Mar 14, 2017 7:30 am
by pythoncoder
I have raised this as an issue on GitHub. https://github.com/micropython/micropython/issues/2955

Re: %string formatting on decimal zero bug

Posted: Wed Mar 15, 2017 11:52 am
by Damien
This is now fixed. Thanks for the report!