Skip to content

Instantly share code, notes, and snippets.

@MorrisJobke
Created February 8, 2017 18:27
Embed
What would you like to do?
Sum up some values
$('[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