forgerpl / pretty_toa

Rust crate for fast convert numbers to strings with thousands separators.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pretty_toa

Rust crate for converting numbers (integers and floats) to strings with thousands separators.

It is very fast because it uses itoa/dtoa crates with stack allocated strings.

Usage Example

extern crate pretty_toa;
use pretty_toa::ThousandsSep;

fn main() {
    let num = 123_4567;
    println!("{} => {}", num, num.thousands_sep());

    let num  = 123_4567.1234567;
    println!("{} => {}", num, num.thousands_sep());
}

About

Rust crate for fast convert numbers to strings with thousands separators.

License:MIT License


Languages

Language:Rust 100.0%