Last active
December 14, 2015 12:19
-
-
Save kissarat/5085816 to your computer and use it in GitHub Desktop.
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
prices = document.getElementsByClassName('preis'); | |
for(i in prices) { | |
var price = prices[i]; | |
price.innerText = 'ab ' + Math.round( | |
parseInt( | |
price.innerText.substring(3) | |
)*0.8) + ',-€'; | |
} | |
prices = document.getElementsByClassName('preis'); | |
var reg = /(\d+)/; | |
for(i in prices) { | |
var price = prices[i]; | |
if(reg.test(price.innerText)) | |
price.innerText = price.innerText.replace(reg, | |
Math.round( | |
parseInt( | |
reg.exec( | |
price.innerText)[0])*0.8)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment