From 0e9215a53e67786a3e01bd1ca77010ddb747ceaf Mon Sep 17 00:00:00 2001 From: Mike Fikes Date: Sun, 14 Jan 2024 15:59:31 -0500 Subject: [PATCH] Overflow should set highest unit (#155) --- Impedance Converter/Impedance Converter/UnitInputView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Impedance Converter/Impedance Converter/UnitInputView.swift b/Impedance Converter/Impedance Converter/UnitInputView.swift index c7598d8..16d7d81 100644 --- a/Impedance Converter/Impedance Converter/UnitInputView.swift +++ b/Impedance Converter/Impedance Converter/UnitInputView.swift @@ -121,8 +121,8 @@ struct UnitInputView: View where UnitType: RawRepresentable & Hashable } } - // Return the original unit if no suitable unit is found - return unit + // Return the last unit if no suitable unit is found + return sortedUnits.last! } private func toggleNegation() {