%string formatting on decimal zero bug

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
evbaarle
Posts: 6
Joined: Mon Mar 13, 2017 6:43 am

%string formatting on decimal zero bug

Post by evbaarle » Tue Mar 14, 2017 6:40 am

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

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: %string formatting on decimal zero bug

Post by pythoncoder » Tue Mar 14, 2017 7:30 am

I have raised this as an issue on GitHub. https://github.com/micropython/micropython/issues/2955
Peter Hinch
Index to my micropython libraries.

Damien
Site Admin
Posts: 647
Joined: Mon Dec 09, 2013 5:02 pm

Re: %string formatting on decimal zero bug

Post by Damien » Wed Mar 15, 2017 11:52 am

This is now fixed. Thanks for the report!

Post Reply