Skip to content

Commit

Permalink
apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
s-nie committed Feb 10, 2022
1 parent ad8431f commit f6b2915
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions egui/src/widgets/plot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ impl CoordinatesFormatter {
pub fn with_decimals(num_decimals: usize) -> Self {
Self {
function: Box::new(move |value, _| {
format!(
"x: {}\ny: {}",
emath::round_to_decimals(value.x, precision).to_string(),
emath::round_to_decimals(value.y, precision).to_string(),
)
format!("x: {:.d$}\ny: {:.d$}", value.x, value.y, d = num_decimals)
}),
}
}
Expand All @@ -58,7 +54,7 @@ impl CoordinatesFormatter {

impl Default for CoordinatesFormatter {
fn default() -> Self {
Self::with_precision(3)
Self::with_decimals(3)
}
}

Expand Down

0 comments on commit f6b2915

Please sign in to comment.