Skip to main content

Crate anzahlmenschen

Crate anzahlmenschen 

Source
Expand description

Anzahl-Menschen (Number-People) is a number formatting library that aims to make your compile times low at all costs so that you don’t need to compile the beast that is serde just so that you can put commas in numbers.

use anzahlmenschen::fmtint;

fn main() {
    let x = 1234567890;
    println!("{}", fmtint(x)); // 1,234,567,890
}

It just works, no need for frills and fancy stuff.

§I’m French! Include a function for me?

I’ve done my work!

use anzahlmenschen::fmtint;

fn main() {
    let x = 1234567890;
    println!("{}", fmtint(x).replace(",", " ")); // 1 234 567 890
}

Functions§

fmtfpn
Take a floating point number and output it as a formatted string with commas.
fmtint
Take an integer and output it as a formatted string with commas.
fmtsnt
Take a signed integer and output it as a formatted string with commas.