fix: use plain number formatter for initial slider label

This commit is contained in:
decodism authored and Louis Pontoise committed 2023-02-23 19:11:55 +01:00
1 parent b99c988970
commit 7cab722df3
1 file changed
+3 -1
@@ -66,7 +66,9 @@ class LabelAndControl: NSObject {
static func makeLabelWithSlider(_ labelText: String, _ rawName: String, _ minValue: Double, _ maxValue: Double, _ numberOfTickMarks: Int, _ allowsTickMarkValuesOnly: Bool, _ unitText: String = "", extraAction: ActionClosure? = nil) -> [NSView] {
let value = defaults.double(rawName)
let suffixText = MeasurementFormatter().string(from: Measurement(value: value, unit: Unit(symbol: unitText)))
let formatter = MeasurementFormatter()
formatter.numberFormatter = NumberFormatter()
let suffixText = formatter.string(from: Measurement(value: value, unit: Unit(symbol: unitText)))
let slider = NSSlider()
slider.minValue = minValue
slider.maxValue = maxValue