Last active
July 10, 2020 08:14
-
-
Save avalanchy/3a4cf3c83a80859085b064685241816c to your computer and use it in GitHub Desktop.
Ile wplacono poprzez X na siepomaga.pl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let amount = parseFloat(document.querySelector(".amount").innerText.replace(" ", "").replace(",", ".")) | |
let payments = document.querySelectorAll(".sp-payment-amount"); | |
let paymentSum = 0; | |
for (let payment of payments) { | |
const paymentFloat = parseFloat(payment.innerText); | |
if (isNaN(paymentFloat)) | |
continue; | |
paymentSum += paymentFloat; | |
} | |
let amountMissing = amount - paymentSum; | |
console.log("Wpłacono poprzez X:", amountMissing); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment