diff options
| -rw-r--r-- | include/mruby/numeric.h | 2 | ||||
| -rw-r--r-- | src/numeric.c | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/include/mruby/numeric.h b/include/mruby/numeric.h index 52e335ade..e09a797ed 100644 --- a/include/mruby/numeric.h +++ b/include/mruby/numeric.h @@ -166,7 +166,7 @@ MRB_API mrb_float mrb_as_float(mrb_state *mrb, mrb_value x); /* internal functions */ mrb_float mrb_div_float(mrb_float x, mrb_float y); -mrb_value mrb_float_to_str(mrb_state *mrb, mrb_value x); +mrb_value mrb_float_to_str(mrb_state *mrb, mrb_value x, const char *fmt); int mrb_format_float(mrb_float f, char *buf, size_t buf_size, char fmt, int prec, char sign); /* obsolete functions; will be removed */ diff --git a/src/numeric.c b/src/numeric.c index a38301caa..b377ce0e6 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -277,8 +277,9 @@ flo_div(mrb_state *mrb, mrb_value x) return mrb_float_value(mrb, a); } -MRB_API mrb_value -mrb_float_to_str(mrb_state *mrb, mrb_value flo) +/* the argument `fmt` is no longer used; you can pass `NULL` */ +mrb_value +mrb_float_to_str(mrb_state *mrb, mrb_value flo, const char *fmt) { char buf[25]; #ifdef MRB_USE_FLOAT32 @@ -330,7 +331,7 @@ flo_to_s(mrb_state *mrb, mrb_value flt) str = mrb_str_new_lit(mrb, "NaN"); } else { - str = mrb_float_to_str(mrb, flt); + str = mrb_float_to_str(mrb, flt, NULL); } RSTR_SET_ASCII_FLAG(mrb_str_ptr(str)); |
