gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-ios] 48/69: fix fractions


From: gnunet
Subject: [taler-taler-ios] 48/69: fix fractions
Date: Fri, 19 Jan 2024 09:02:21 +0100

This is an automated email from the git hooks/post-receive script.

marc-stibane pushed a commit to branch master
in repository taler-ios.

commit 5e8eda4c96cddc316a4903a8017dcaa334d11c22
Author: Marc Stibane <marc@taler.net>
AuthorDate: Thu Jan 18 00:01:49 2024 +0100

    fix fractions
---
 taler-swift/Sources/taler-swift/Amount.swift | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/taler-swift/Sources/taler-swift/Amount.swift 
b/taler-swift/Sources/taler-swift/Amount.swift
index 024201c..9866301 100644
--- a/taler-swift/Sources/taler-swift/Amount.swift
+++ b/taler-swift/Sources/taler-swift/Amount.swift
@@ -251,7 +251,7 @@ public final class Amount: Codable, Hashable, @unchecked 
Sendable, CustomStringC
     public init(currency: String, cent: UInt64) {
         self.currency = currency
         self.integer = cent / 100   // For existing currencies, fractional 
digits could be 0, 2 or 3
-        self.fraction = UInt32(cent - (self.integer * 100))
+        self.fraction = UInt32(cent - (self.integer * 100)) * 
(Self.fractionalBase() / 100)
     }
 
     /// Initializes an amount from a decoder.

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]