← Standard library

StringFormatter

static class StringFormatter
import StringFormatter from Wax;

Low-level shortest-round-trip float and double formatting into caller-owned byte storage. Prefer primitive ToString or StringBuilder when buffer management is unnecessary. A 40-byte destination accommodates these shortest forms. Results are UTF-8/ASCII bytes without a terminator.

StringFormatter.wax:74

Inherits from object. Follow these links for inherited members.

Members

FormatDoublemethod

public static fn FormatDouble(Span<uint8> buf, double v) : int32

Writes the shortest round-trip form of the supplied floating-point value at the start of the span, returning the number of bytes written. NaN, infinities, and signed zero are handled explicitly. Insufficient destination space can panic after partial writes.

StringFormatter.wax:765

FormatFloatmethod

public static fn FormatFloat(Span<uint8> buf, float v) : int32

Writes the shortest round-trip form of the supplied floating-point value at the start of the span, returning the number of bytes written. NaN, infinities, and signed zero are handled explicitly. Insufficient destination space can panic after partial writes.

StringFormatter.wax:817