change %a to %f in number->string
This commit is contained in:
parent
15889a5feb
commit
569b1ace02
4
number.c
4
number.c
|
@ -546,9 +546,9 @@ pic_number_number_to_string(pic_state *pic)
|
||||||
return pic_obj_value(pic_make_str(pic, buf, sizeof buf - 1));
|
return pic_obj_value(pic_make_str(pic, buf, sizeof buf - 1));
|
||||||
}
|
}
|
||||||
else {
|
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));
|
return pic_obj_value(pic_make_str(pic, buf, sizeof buf - 1));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue