fix: set slider max decimals

This commit is contained in:
mostafaei2002 2024-06-11 22:18:11 +03:30
parent e0378903d9
commit cc597a31b9

View file

@ -201,7 +201,7 @@ impl crate::disk::state::Xvb {
ui.spacing_mut().slider_width = width * 0.5; ui.spacing_mut().slider_width = width * 0.5;
ui.add_sized( ui.add_sized(
[width, text_edit], [width, text_edit],
egui::Slider::new(&mut self.manual_slider_amount, 0.0..=(hashrate_xmrig as f64)) egui::Slider::new(&mut self.manual_slider_amount, 0.0..=(hashrate_xmrig as f64)).max_decimals(3)
).on_hover_text(slider_help_text); ).on_hover_text(slider_help_text);
if ui.add(egui::SelectableLabel::new(self.manual_donation_metric == ManualDonationMetric::Hash, "H/s")).clicked() { if ui.add(egui::SelectableLabel::new(self.manual_donation_metric == ManualDonationMetric::Hash, "H/s")).clicked() {