src/lobject.c
static int tostringbuff (TValue *obj, char *buff) {
  int len;
  lua_assert(ttisnumber(obj));
  if (ttisinteger(obj))
    len = lua_integer2str(buff, MAXNUMBER2STR, ivalue(obj));
  else {
    len = lua_number2str(buff, MAXNUMBER2STR, fltvalue(obj));
    if (buff[strspn(buff, "-0123456789")] == '\0') {  /* looks like an int? */
      buff[len++] = lua_getlocaledecpoint();
      buff[len++] = '0';  /* adds '.0' to result */
    }
  }
  return len;
}
/*
** Convert a number object to a string, adding it to a buffer
*/
Convert a number object to a string, adding it to a buffer
Convert a number object to a string adding it to a buffer
static int tostringbuff (TValue *obj, char *buff) {
  int len;
  lua_assert(ttisnumber(obj));
  if (ttisinteger(obj))
    len = lua_integer2str(buff, MAXNUMBER2STR, ivalue(obj));
  else {
    len = lua_number2str(buff, MAXNUMBER2STR, fltvalue(obj));
    if (buff[strspn(buff, "-0123456789")] == '\0') {  
      buff[len++] = lua_getlocaledecpoint();
      buff[len++] = '0';  
    }
  }
  return len;
}
static int tostringbuff ( TValue * obj , char * buff ) { int len ; lua_assert ( ttisnumber ( obj ) ) ; if ( ttisinteger ( obj ) ) len = lua_integer2str ( buff , MAXNUMBER2STR , ivalue ( obj ) ) ; else { len = lua_number2str ( buff , MAXNUMBER2STR , fltvalue ( obj ) ) ; if ( buff [ strspn ( buff , " " ) ] == ' \0 ' ) { buff [ len ++ ] = lua_getlocaledecpoint ( ) ; buff [ len ++ ] = ' ' ; } } return len ; }
Convert a number object to a string, adding it to a buffer
Convert a number object to a string adding it to a buffer
/* looks like an int? */ /* adds '.0' to result */