Difference between revisions of "Ftos"
Jump to navigation
Jump to search
(Created page with "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") |
|||
Line 2: | Line 2: | ||
It is one of very few string methods in vanilla quake c | 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. | |||
{| class="wikitable" | |||
|+ | |||
!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 | |||
|} |
Revision as of 07:36, 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 |