# `QuakeServer.Builtins.Text`
[🔗](https://github.com/jaman/quake_server/blob/v0.1.0/lib/quake_server/builtins/text.ex#L1)

Numbers as FTE's `ftos` and `vtos` write them for a QuakeC program.

`ftos/1` gives a whole number as an integer and anything else as FTE's `Q_ftoa`: the
32-bit float written with as many decimals as its exponent allows (eight more than the
negated power of ten of its binary exponent), trailing zeros and a bare point dropped.
`ftos/2` with `broken: true` (the cvar `pr_brokenfloatconvert`) writes a fraction as
`%5.1f` instead. `vtos/1` gives the three numbers as `%f` (six decimals) between single
quotes.

    QuakeServer.Builtins.Text.ftos(3.0)
    #=> "3"

    QuakeServer.Builtins.Text.ftos(0.75)
    #=> "0.75"

    QuakeServer.Builtins.Text.vtos({1.0, -2.5, 0.0})
    #=> "'1.000000 -2.500000 0.000000'"

# `ftoa`

```elixir
@spec ftoa(number()) :: String.t()
```

A float as FTE's `Q_ftoa` writes it.

# `ftos`

```elixir
@spec ftos(number(), keyword()) :: String.t()
```

A float as `ftos` writes it.

# `vtos`

```elixir
@spec vtos({number(), number(), number()}) :: String.t()
```

A vector as `vtos` writes it.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
