Last active
July 17, 2023 22:16
-
-
Save emeraldsanto/a7248c2faf1df12d681e635854cedd08 to your computer and use it in GitHub Desktop.
Script to sum the amount of all Compt claims
This file contains 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
[...document.querySelectorAll('#past-expenses-table .td.small:nth-child(5)')].reduce( | |
(total, cell) => { | |
const amountWithCurrencyAsString = cell.innerHTML; | |
const amountWithoutCurrencyAsString = amountWithCurrencyAsString.slice(3); // $CA... | |
return total + parseFloat(amountWithoutCurrencyAsString); | |
}, | |
0 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment