Phase 4: Steuerelemente implementieren

This commit is contained in:
2026-09-05 12:49:46 +02:00
parent 1cb6ae8fd9
commit 19804e0e2d
36 changed files with 6472 additions and 689 deletions

View File

@@ -316,7 +316,7 @@ fn tausender_gruppieren(s: &str) -> String {
let z: Vec<char> = s.chars().collect();
let mut out = String::new();
for (i, c) in z.iter().enumerate() {
if i > 0 && (z.len() - i) % 3 == 0 {
if i > 0 && (z.len() - i).is_multiple_of(3) {
out.push(',');
}
out.push(*c);
@@ -433,7 +433,7 @@ mod tests {
#[test]
fn numerisches_feld_mit_nachkommastellen() {
assert_eq!(u("###.##", &[z(3.14159)]), " 3.14");
assert_eq!(u("###.##", &[z(3.126)]), " 3.13");
assert_eq!(u("##.##", &[z(-1.5)]), "-1.50");
}