taler-ios

iOS apps for GNU Taler (wallet)
Log | Files | Refs | README | LICENSE

commit ac5aa3eed2ea4bff24f80d863ee1d52a0d156b4b
parent b9ea159419f0be5203b74befabdf0d184128f7b5
Author: Marc Stibane <marc@taler.net>
Date:   Thu, 24 Apr 2025 06:00:40 +0200

rounding error

Diffstat:
MTalerWallet1/Views/OIM/OIMView.swift | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/TalerWallet1/Views/OIM/OIMView.swift b/TalerWallet1/Views/OIM/OIMView.swift @@ -11,9 +11,9 @@ import taler_swift fileprivate func intValue(_ amount: Amount?) -> UInt64 { if let amount { if !amount.isZero { - let value = amount.value * 100 // TODO: currency specs instead of 100 -// print("intValue: \(Int(value)) \(currency.noteBase)") - return UInt64(value) + let int = amount.integer * 100 // TODO: currency specs instead of 100 + let frac = amount.fraction / 1_000_000 // drop 6 zeroes + return int + UInt64(frac) } } return 0