← Standard library

StringFormatterFixed

static class StringFormatterFixed
import StringFormatterFixed from Wax;

Low-level fixed, scientific, and general double formatting into caller-owned storage. Precision must be nonnegative, and the destination must fit the complete result. Methods return byte counts and write no terminator; too-small buffers may contain partial output after a panic. Prefer StringBuilder or primitive Format when automatic capacity management is desired.

StringFormatterFixed.wax:59

Inherits from object. Follow these links for inherited members.

Members

FormatDoubleFixedmethod

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

Writes fixed notation with exactly precision fractional digits and returns the number of bytes written. Use nonnegative precision and enough destination space.

StringFormatterFixed.wax:2442

FormatDoubleExpmethod

public static fn FormatDoubleExp(Span<uint8> buf, double v, int32 precision, bool upperExp) : int32

Writes scientific notation with exactly precision fractional digits and returns the number of bytes written. Use nonnegative precision and enough destination space. upperExp selects E versus e in an exponent.

StringFormatterFixed.wax:2598

FormatDoubleGmethod

public static fn FormatDoubleG(Span<uint8> buf, double v, int32 precision, bool upperExp) : int32

Writes general notation with precision significant digits, selecting fixed or scientific form and trimming trailing fractional zeros and returns the number of bytes written. Use nonnegative precision and enough destination space. upperExp selects E versus e in an exponent. Zero precision means one significant digit.

StringFormatterFixed.wax:2800