Skip to main content

Crate format_number

Crate format_number 

Source
Expand description

Fast integer-to-string conversion with a stack-allocated buffer and #![no_std] support.

§Example

// Reusable buffer
let mut buf = format_number::Buffer::new();
assert_eq!(buf.format(42u64), "42");
assert_eq!(buf.format(-99i32), "-99");

// One-shot convenience
let buf = format_number::format_int(2024);
assert!(buf == "2024");

Structs§

Buffer
Stack-allocated buffer for integer-to-string conversion.

Traits§

Integer
An integer type that can be formatted into a Buffer.

Functions§

format_int
One-shot convenience: formats an integer into a new Buffer and returns it.