diff --git a/android/src/main/java/com/nextar/sumup/RNSumUpModule.java b/android/src/main/java/com/nextar/sumup/RNSumUpModule.java index 5e3e301..20d67a4 100644 --- a/android/src/main/java/com/nextar/sumup/RNSumUpModule.java +++ b/android/src/main/java/com/nextar/sumup/RNSumUpModule.java @@ -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())