str_for_num(STRING*, var x)

str_for_int(STRING*, long x)

str_for_float(STRING*, double x)

Sets the string to the character representation of the number x. str_for_num generates strings with 3 decimals and A7.20 str_for_float generates strings with 6 decimals.

Parameters:

STRING* STRING pointer, or NULL for returning a temporary string.
x var, long, or double variable.

Returns:

STRING*

Speed:

Fast

Example:

STRING* s = "     ";
...
str_for_num(s,sqrt(2)); // now s == "1.414"

See also:

str_to_num, str_setchr, str_getchr, str_for_entname, str_for_entfile

► latest version online