Skip to content
Snippets Groups Projects
Commit 60be1cf3 authored by Damien George's avatar Damien George
Browse files

py: Fix float printing on stmhal.

parent 12bab72d
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,10 @@ STATIC void float_print(void (*print)(void *env, const char *fmt, ...), void *en
char buf[32];
format_float(o->value, buf, sizeof(buf), 'g', 6, '\0');
print(env, "%s", buf);
if (strchr(buf, '.') == NULL) {
// Python floats always have decimal point
print(env, ".0");
}
#else
char buf[32];
sprintf(buf, "%.8g", (double) o->value);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment