%string formatting on decimal zero bug

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

%string formatting on decimal zero bug

Postby 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: 1564
Joined: Fri Jul 18, 2014 8:01 am

Re: %string formatting on decimal zero bug

Postby 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

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

Re: %string formatting on decimal zero bug

Postby Damien » Wed Mar 15, 2017 11:52 am

This is now fixed. Thanks for the report!


Return to “Development of MicroPython”

Who is online

Users browsing this forum: No registered users and 2 guests