From 85aa07ab7d06a47a79aa1232953fb2a371452a3c Mon Sep 17 00:00:00 2001 From: cdricms <36056008+cdricms@users.noreply.github.com> Date: Sun, 14 Sep 2025 15:07:43 +0200 Subject: [PATCH] Identifiable --- Sources/Units/Units.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/Units/Units.swift b/Sources/Units/Units.swift index 2f42d72..6962c08 100644 --- a/Sources/Units/Units.swift +++ b/Sources/Units/Units.swift @@ -206,12 +206,16 @@ public enum Unit: String, CaseIterable, CustomStringConvertible, Codable, // but the internal `value` will be stored as a `Double`. public struct UnitValue: CustomStringConvertible, Equatable, - Comparable, Codable + Comparable, Codable, Identifiable { // Store the value internally as a Double for consistent calculations public let value: Double public let unit: Unit + public var id: String { + description + } + // MARK: Initialization /// Initializes UnitValue, converting the input value to Double. // MARK: Initialization