Commit d6537153 authored by Damien George's avatar Damien George
Browse files

py/mpprint: Fix int formatting so "+" is printed for 0-valued integer.

parent 8cd4911e
......@@ -222,7 +222,7 @@ int mp_print_mp_int(const mp_print_t *print, mp_obj_t x, int base, int base_char
char prefix_buf[4];
char *prefix = prefix_buf;
if (mp_obj_int_sign(x) > 0) {
if (mp_obj_int_sign(x) >= 0) {
if (flags & PF_FLAG_SHOW_SIGN) {
*prefix++ = '+';
} else if (flags & PF_FLAG_SPACE_SIGN) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment