pub mod selector;

pub fn format_rating(val: Option<f64>) -> String {
    match val {
        Some(v) => {
            let rounded = v.round() as i64;
            if rounded > 0 {
                format!("+{rounded}")
            } else {
                rounded.to_string()
            }
        }
        None => "\u{2014}".to_string(),
    }
}

pub fn format_swar(val: Option<f64>) -> String {
    match val {
        Some(v) => format!("{v:.2}"),
        None => "\u{2014}".to_string(),
    }
}
