gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: fix balance number type


From: gnunet
Subject: [libeufin] branch master updated: fix balance number type
Date: Mon, 19 Jul 2021 12:05:31 +0200

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

ms pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new 6c9267d  fix balance number type
6c9267d is described below

commit 6c9267d83ebf10e2063f882e30a1fbcd0e5524a9
Author: ms <ms@taler.net>
AuthorDate: Mon Jul 19 12:05:22 2021 +0200

    fix balance number type
---
 sandbox/src/main/kotlin/tech/libeufin/sandbox/bankAccount.kt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/bankAccount.kt 
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/bankAccount.kt
index d55f091..49e6988 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/bankAccount.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/bankAccount.kt
@@ -13,20 +13,20 @@ import java.math.BigInteger
 
 private val logger: Logger = LoggerFactory.getLogger("tech.libeufin.sandbox")
 
-fun balanceForAccount(iban: String): BigInteger {
+fun balanceForAccount(iban: String): java.math.BigDecimal {
     logger.debug("Calculating balance for account: ${iban}")
-    var balance = BigInteger.ZERO
+    var balance = java.math.BigDecimal.ZERO
     transaction {
         BankAccountTransactionsTable.select {
             BankAccountTransactionsTable.creditorIban eq iban
         }.forEach {
-            val amount = BigInteger(it[amount])
+            val amount = java.math.BigDecimal(it[amount])
             balance += amount
         }
         BankAccountTransactionsTable.select {
             BankAccountTransactionsTable.debtorIban eq iban
         }.forEach {
-            val amount = BigInteger(it[amount])
+            val amount = java.math.BigDecimal(it[amount])
             balance -= amount
         }
     }

-- 
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]