1
2
3
4
5
6
7
8
9
10
11
use std::fmt::{Display, Formatter};
use thousands::Separable;

/// Format a number in a locale specific way
pub struct Formatted(pub usize);

impl Display for Formatted {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        write!(f, "{}", self.0.separate_with_commas())
    }
}