diff --git a/crates/egui/src/widgets/slider.rs b/crates/egui/src/widgets/slider.rs index 84e47aee..74f792e5 100644 --- a/crates/egui/src/widgets/slider.rs +++ b/crates/egui/src/widgets/slider.rs @@ -279,6 +279,12 @@ impl<'a> Slider<'a> { self } + #[inline] + pub fn max_decimals_opt(mut self, max_decimals: Option) -> Self { + self.max_decimals = max_decimals; + self + } + /// Set an exact number of decimals to display. /// /// Values will also be rounded to this number of decimals.