Function count
pub fn count(n: u64) -> StringExpand description
A whole count with the current locale’s digit grouping: 12,345 in
English, 12.345 in German, 12\u{202f}345 in French. Use it for every
count a person reads in full (rows, files, results); compact_count for
the abbreviated form.
use tilo_ui::format::count_in;
assert_eq!(count_in(0, "en-US"), "0");
assert_eq!(count_in(999, "en-US"), "999");
assert_eq!(count_in(12_345, "en-US"), "12,345");
assert_eq!(count_in(1_234_567, "de-DE"), "1.234.567");
assert_eq!(count_in(1_234, "fr"), "1\u{202f}234");