number->string: remove trailing 0s
This commit is contained in:
parent
e3d2330df7
commit
a8520fe595
|
@ -549,7 +549,12 @@ pic_number_number_to_string(pic_state *pic)
|
|||
|
||||
buf = pic_malloc(pic, s);
|
||||
|
||||
|
||||
snprintf(buf, s, "%f", f);
|
||||
|
||||
while(buf[s - 2] == '0')
|
||||
s -= 1;
|
||||
|
||||
}
|
||||
str = pic_make_str(pic, buf, s - 1);
|
||||
|
||||
|
|
Loading…
Reference in New Issue