BolusDisplayThreshold.swift 630 B

1234567891011121314151617181920212223
  1. import Foundation
  2. enum BolusDisplayThreshold: Decimal, JSON, CaseIterable, Identifiable, Codable, Hashable {
  3. public var id: Decimal { rawValue }
  4. case oneUnit = 1
  5. case halfUnit = 0.5
  6. case pointOneUnit = 0.1
  7. case allUnits = 0.01
  8. var displayName: String {
  9. switch self {
  10. case .oneUnit:
  11. return String(localized: "1 U and over")
  12. case .halfUnit:
  13. return String(localized: "0.5 U and over")
  14. case .pointOneUnit:
  15. return String(localized: "0.1 U and over")
  16. case .allUnits:
  17. return String(localized: "Show All")
  18. }
  19. }
  20. }