Last active
September 27, 2016 13:42
-
-
Save rutger1140/c55c9322f2598f4a0cf3fd9a2d6a81ba to your computer and use it in GitHub Desktop.
Spotify total cost
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
var t = 0; | |
$(".receipt-price").each(function() { | |
// EU version - comma decimal separator | |
t += parseFloat($(this).text().substring(1).replace(',','.')); | |
// US version - dot decimal separator | |
// t += parseFloat($(this).text().substring(1)); | |
}); | |
console.log(t.toFixed(2)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The ES6 variant 😛