mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
remove trailing zeros from float string representation
This commit is contained in:
@@ -181,6 +181,12 @@ mrb_flo_to_str(mrb_state *mrb, mrb_value flo)
|
||||
*(c++) = '.';
|
||||
}
|
||||
}
|
||||
if (c[-1] == '0') {
|
||||
while (&s[0] < c && c[-1] == '0') {
|
||||
c--;
|
||||
}
|
||||
c++;
|
||||
}
|
||||
|
||||
if (e) {
|
||||
*(c++) = 'e';
|
||||
|
||||
Reference in New Issue
Block a user