change %a to %f in number->string

This commit is contained in:
Léon van Velzen 2014-11-07 19:24:47 +01:00
parent 15889a5feb
commit 569b1ace02
1 changed files with 2 additions and 2 deletions

View File

@ -546,9 +546,9 @@ pic_number_number_to_string(pic_state *pic)
return pic_obj_value(pic_make_str(pic, buf, sizeof buf - 1));
}
else {
char buf[snprintf(NULL, 0, "%a", f) + 1];
char buf[snprintf(NULL, 0, "%f", f) + 1];
snprintf(buf, sizeof buf, "%a", f);
snprintf(buf, sizeof buf, "%f", f);
return pic_obj_value(pic_make_str(pic, buf, sizeof buf - 1));
}