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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

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.