| 78 | const MIN_MIN_STEPS: f64 = 3.; |
| 79 | |
| 80 | pub fn get_steps(max: f64, mut min_steps: f64) -> f64 { |
| 81 | //let mut steps = 4.; |
| 82 | if max >= min_steps { |
| 83 | while max % min_steps != 0. { |
| 84 | min_steps += 1.; |
| 85 | |
| 86 | if min_steps == MAX_MIN_STEPS { |
| 87 | return MAX_MIN_STEPS; |
| 88 | } |
| 89 | } |
| 90 | return min_steps; |
| 91 | } |
| 92 | /* |
| 93 | let max = count_inv_tens(max) as f64 * max * 10.; |
| 94 | while max % min_steps != 0. { |
| 95 | min_steps -= 1.; |
| 96 | println!("min_steps: {min_steps}"); |
| 97 | } |
| 98 | */ |
| 99 | if min_steps < MIN_MIN_STEPS { |
| 100 | return MIN_MIN_STEPS; |
| 101 | } |
| 102 | min_steps |
| 103 | } |
| 104 | |
| 105 | pub fn max_display(max: f64, other_scaling: bool) -> f64 { |
| 106 | if max == 0. { |