** Convert a number object to a string, adding it to a buffer. */
| 447 | ** Convert a number object to a string, adding it to a buffer. |
| 448 | */ |
| 449 | unsigned luaO_tostringbuff (const TValue *obj, char *buff) { |
| 450 | int len; |
| 451 | lua_assert(ttisnumber(obj)); |
| 452 | if (ttisinteger(obj)) |
| 453 | len = lua_integer2str(buff, LUA_N2SBUFFSZ, ivalue(obj)); |
| 454 | else |
| 455 | len = tostringbuffFloat(fltvalue(obj), buff); |
| 456 | lua_assert(len < LUA_N2SBUFFSZ); |
| 457 | return cast_uint(len); |
| 458 | } |
| 459 | |
| 460 | |
| 461 | /* |
no test coverage detected