1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 14:49:06 -04:00

Add Slider::max_decimals_opt (#4953)

As mentioned in #4950 I added `max_decimals_opt` to the Slider

* Closes <https://github.com/emilk/egui/issues/4950>
* [x] I have followed the instructions in the PR template
* [x] I ran the script in `scripts/check.sh`
This commit is contained in:
Nicolas
2024-08-26 15:36:50 +02:00
committed by GitHub
parent 9f2f5f7292
commit 5a1ab9b2b8

View File

@@ -279,6 +279,12 @@ impl<'a> Slider<'a> {
self
}
#[inline]
pub fn max_decimals_opt(mut self, max_decimals: Option<usize>) -> 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.