[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] 02/03: fix rounding helper
From: |
gnunet |
Subject: |
[libeufin] 02/03: fix rounding helper |
Date: |
Tue, 23 May 2023 14:09:01 +0200 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository libeufin.
commit b286dafa4d7d4aee682b6bb4c6fbb2cc663dbc96
Author: MS <ms@taler.net>
AuthorDate: Tue May 23 14:07:45 2023 +0200
fix rounding helper
---
sandbox/src/main/kotlin/tech/libeufin/sandbox/CircuitApi.kt | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/CircuitApi.kt
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/CircuitApi.kt
index e44dc227..0ed53185 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/CircuitApi.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/CircuitApi.kt
@@ -15,6 +15,7 @@ import java.io.File
import java.io.InputStreamReader
import java.math.BigDecimal
import java.math.MathContext
+import java.math.RoundingMode
import java.util.concurrent.TimeUnit
import kotlin.text.toByteArray
@@ -148,8 +149,9 @@ fun generateCashoutSubject(
}
fun BigDecimal.roundToTwoDigits(): BigDecimal {
- val twoDigitsRounding = MathContext(2)
- return this.round(twoDigitsRounding)
+ // val twoDigitsRounding = MathContext(2)
+ // return this.round(twoDigitsRounding)
+ return this.setScale(2, RoundingMode.HALF_UP)
}
/**
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.