commit dc692df2a23b63085572416529330f6635a6f91a parent bbcc891c8aaa0c1ff5729206988c1bf516149d67 Author: Marc Stibane <marc@taler.net> Date: Mon, 29 Jun 2026 13:25:00 +0200 fix wrong unit conversion Diffstat:
| M | taler-swift/Sources/taler-swift/Time.swift | | | 4 | ++-- |
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/taler-swift/Sources/taler-swift/Time.swift b/taler-swift/Sources/taler-swift/Time.swift @@ -251,7 +251,7 @@ public func +(lhs: Timestamp, rhs: Duration) -> Timestamp { case .milliseconds(let lhs_ms): switch rhs { case .microseconds(let rhs_us): - let result = lhs_ms.addingReportingOverflow(rhs_us * 1000) + let result = lhs_ms.addingReportingOverflow(rhs_us / 1000) if result.overflow { return Timestamp.never } else { @@ -271,7 +271,7 @@ public func -(lhs: Timestamp, rhs: Duration) -> Timestamp { case .milliseconds(let lhs_ms): switch rhs { case .microseconds(let rhs_us): - let result = lhs_ms.subtractingReportingOverflow(rhs_us * 1000) + let result = lhs_ms.subtractingReportingOverflow(rhs_us / 1000) if result.overflow { return Timestamp.milliseconds(0) } else {