Difference between revisions of "Ftos"
Jump to navigation
Jump to search
m (Added to "Quake-C Builtins" category) |
|||
Line 35: | Line 35: | ||
|6 | |6 | ||
|} | |} | ||
[[Category:Quake-C Builtins]] |
Revision as of 12:55, 16 February 2022
ftos is a quake-c function which converts a single floating point to a string (thus the contracted name f-to-s).
It is one of very few string methods in vanilla quake c
There are lots of different needs when turning numbers into strings. ftos has quirks most especially that it doesn't always produce a string containing only numbers.
function call | string output | string length |
---|---|---|
ftos(3) | "3" | 1 |
ftos(3.0) | "3" | 1 |
ftos(3.1) | " 3.1" | 5 |
ftos(23.1) | " 23.1" | 5 |
ftos(123.1) | "123.1" | 5 |
ftos(1234.1) | "1234.1" | 6 |