//! How a health card says its numbers: grouped, its dial's round top, a //! night's hours. Pure: no rows. use super::*; /// RULE (Cotton Health's faces, 13 Nov 2026): a card's number is grouped by thousands with the measure's own decimals, a length of sleep is said in hours and minutes, and the pedometer's dial tops at a round figure (1, 2, 2.5 or 5 of a power of ten) a little above the most it shows. #[test] fn a_health_card_says_its_numbers_roundly() { assert_eq!(grouped(8123.0, 0), "8,123"); assert_eq!(grouped(1234567.4, 0), "1,234,567"); assert_eq!(grouped(71.64, 1), "71.6"); assert_eq!(grouped(999.0, 0), "999"); assert_eq!(dial_top(8123.0), 10000.0); assert_eq!(dial_top(10233.0), 20000.0); assert_eq!(dial_top(61.0), 100.0); assert_eq!(dial_top(4.0), 5.0); assert_eq!(dial_top(0.0), 1.0); let cards = LineSet::of_rows("cards", &[]).expect("the kit ships the cards set"); assert_eq!(minutes_said(330.0, &cards), "5 h 30 min"); assert_eq!(minutes_said(42.4, &cards), "42 min"); assert_eq!(value_said("distance", 5200.0, &cards), ("5.2".to_string(), "km".to_string())); assert_eq!(value_said("sleep_deep", 61.0, &cards), ("1 h 1 min".to_string(), String::new())); }