Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
number->string: remove trailing 0s
Browse files Browse the repository at this point in the history
  • Loading branch information
KeenS committed May 11, 2015
1 parent e3d2330 commit a8520fe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions extlib/benz/number.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit a8520fe

Please sign in to comment.