Skip to main content

quantity

Function quantity 

Source
pub fn quantity(locale: &str, number: &str, unit: &str) -> String
Expand description

A number already written followed by its unit, with the locale’s space between them (the number alone when unit is empty).

use egui_pop_i18n::format;

assert_eq!(format::quantity("fr", "1,5", "EV"), "1,5\u{202f}EV");
assert_eq!(format::quantity("en", "50", "%"), "50 %");