Use the f32_hz_then_khz formatter

This commit is contained in:
Robbert van der Helm
2022-03-21 14:44:26 +01:00
parent 0f60ce9609
commit 5b2f8a417b
2 changed files with 6 additions and 5 deletions

View File

@@ -69,10 +69,10 @@ impl Default for SineParams {
},
)
.with_smoother(SmoothingStyle::Linear(10.0))
.with_unit(" Hz")
// We purposely don't specify a step size here, but the parameter should still be
// displaeyd as rounded
.with_value_to_string(formatters::f32_rounded(0)),
// displayed as if it were rounded. This formatter also includes the unit.
.with_value_to_string(formatters::f32_hz_then_khz(0))
.with_string_to_value(formatters::from_f32_hz_then_khz()),
use_midi: BoolParam::new("Use MIDI", false),
}
}