From d4dc65c43a64aae95b36f84ad8ff0913e5a868e1 Mon Sep 17 00:00:00 2001 From: Huck Boles Date: Sun, 9 Jul 2023 14:56:30 -0500 Subject: [PATCH] fixed: number formatting --- src/display.rs | 2 +- src/lib.rs | 2 +- src/midi.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/display.rs b/src/display.rs index 44b010a..cecdead 100644 --- a/src/display.rs +++ b/src/display.rs @@ -230,7 +230,7 @@ fn randomize_section<'a>(r: f32) -> Element<'a, Message> { Message::RandChanged(x / 100.0) }) .width(Length::Fixed(300.0)), - text(format!("{r}")), + text(format!("{}", (r * 100.0).round())), ] .spacing(10) .align_items(Alignment::Center), diff --git a/src/lib.rs b/src/lib.rs index 628df32..91b40ac 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -245,7 +245,7 @@ impl Application for CellSeq { let probability_slider = container( column![ - text(format!("{}", self.info.probability)), + text(format!("{}", (self.info.probability * 100.0).round())), vertical_slider(0.0..=100.0, self.info.probability * 100.0, |x| { Message::ProbChanged(x / 100.0) }), diff --git a/src/midi.rs b/src/midi.rs index 1181daa..7c722e4 100644 --- a/src/midi.rs +++ b/src/midi.rs @@ -73,7 +73,7 @@ impl MidiLink { for _ in 0..hits { if count > info.voices { break; - } else if random::() < info.probability { + } else if random::() > info.probability { count += 1; continue; } else { -- 2.45.2