number->string: remove trailing 0s

This commit is contained in:
Sunrin SHIMURA (keen) 2015-05-11 16:26:55 +09:00
parent e3d2330df7
commit a8520fe595
1 changed files with 5 additions and 0 deletions

View File

@ -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);