Modules / Standard library
std/format
Text built on an owned Vec(u8) builder. Append adds one value's text, and BuilderPrint(*builder, "x=%\n", x) appends a whole formatted piece: each % takes the next argument's text and %% writes one percent. BuilderFinish turns the builder into a string. line: Vec(u8) BuilderPrint(*line, "% of % done\n", finished, total) text := BuilderFinish(line) Integers are written in base ten, bools as true or false, and floats with up to six digits after the point, trailing zeros dropped.
Stable Shipped in release v0.4.2.
Import with #import "std/format".
Append :: (builder: *Vec(u8), text: string)
Append :: (builder: *Vec(u8), value: s64)
Append :: (builder: *Vec(u8), value: u32)Unsigned values up to 32 bits; also the closest match for u8 and u16.
Append :: (builder: *Vec(u8), value: u64)
Append :: (builder: *Vec(u8), value: bool)
Append :: (builder: *Vec(u8), value: float64)
Source ↗ · All modules