소스 검색

Display "" instead of 0.

(cherry picked from commit 154d5f7abfb18cedfd28a61b3242951d62f2e6b4)
Jon Mårtensson 3 년 전
부모
커밋
28df23f89a
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      FreeAPS/Sources/Views/DecimalTextField.swift

+ 3 - 1
FreeAPS/Sources/Views/DecimalTextField.swift

@@ -67,7 +67,9 @@ struct DecimalTextField: UIViewRepresentable {
         let coordinator = context.coordinator
         if coordinator.isEditing {
             coordinator.resetEditing()
-        } else /* if value != 0 */ {
+        } else if value == 0 {
+            textField.text = ""
+        } else {
             textField.text = formatter.string(for: value)
         }
     }