Skip to content

Commit

Permalink
Checkout total number float point fix
Browse files Browse the repository at this point in the history
  • Loading branch information
viktoras-jego committed Jun 1, 2018
1 parent eebd874 commit 78dd4da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion android/src/main/java/com/nextar/sumup/RNSumUpModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public void checkout(ReadableMap request, Promise promise) {
try {
SumUpPayment.Currency currencyCode = this.getCurrency(request.getString("currencyCode"));
SumUpPayment payment = SumUpPayment.builder()
.total(new BigDecimal(Double.parseDouble(request.getString("totalAmount"))))
.total(new BigDecimal(request.getString("totalAmount")).setScale(2, RoundingMode.HALF_EVEN))
.currency(currencyCode)
.title(request.getString("title"))
.foreignTransactionId(UUID.randomUUID().toString())
Expand Down

0 comments on commit 78dd4da

Please sign in to comment.