Created
February 8, 2017 18:27
-
-
Save MorrisJobke/49fdfa601a1a4a080f202c0b83bb434e to your computer and use it in GitHub Desktop.
Sum up some values
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
$('[field="amount_usdollar"]') | |
.map(function(index, value){ | |
return $(value) | |
.text() | |
.trim() | |
.replace(',', '') | |
.replace('€',''); | |
}) | |
.toArray() | |
.map(function(value){ | |
return parseFloat(value); | |
}) | |
.reduce(function(a, b){ | |
return a + b; | |
}, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment