Skip to main content

number_to_human

Function number_to_human 

Source
pub fn number_to_human(value: impl Display) -> String
Expand description

Three significant digits and a word, Thousand to Quadrillion: 1234567 becomes 1.23 Million (Rails’ number_to_human).

§Examples

assert_eq!(ocre::helpers::number_to_human(489_939), "490 Thousand");
assert_eq!(ocre::helpers::number_to_human(123), "123");