From d9832699085d60e21002e4ba76e3e3fd0480d9e8 Mon Sep 17 00:00:00 2001 From: dearblue Date: Sat, 11 Apr 2020 20:30:03 +0900 Subject: Add `mrb_float_to_cstr()` MRB_API function In order to share the same operation with `mrb_float_to_str()`, the internal structure is modified. --- include/mruby/numeric.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/mruby/numeric.h b/include/mruby/numeric.h index a176d96cd..06a33cc6f 100644 --- a/include/mruby/numeric.h +++ b/include/mruby/numeric.h @@ -37,6 +37,7 @@ MRB_API mrb_value mrb_fixnum_to_str(mrb_state *mrb, mrb_value x, mrb_int base); /* ArgumentError if format string doesn't match /%(\.[0-9]+)?[aAeEfFgG]/ */ #ifndef MRB_WITHOUT_FLOAT MRB_API mrb_value mrb_float_to_str(mrb_state *mrb, mrb_value x, const char *fmt); +MRB_API int mrb_float_to_cstr(mrb_state *mrb, char *buf, size_t len, const char *fmt, mrb_float f); MRB_API mrb_float mrb_to_flo(mrb_state *mrb, mrb_value x); MRB_API mrb_value mrb_int_value(mrb_state *mrb, mrb_float f); #endif -- cgit v1.2.3