Last active
October 13, 2015 04:27
-
-
Save cbednarski/4138965 to your computer and use it in GitHub Desktop.
javascript code to convert AWS hour rates to monthly rates (put it in a bookmarklet)
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
rates = jQuery(".rate"); | |
for(i in rates) { | |
rate = rates[i].innerHTML; | |
if(rate){ | |
matches = rate.match(/\$([\d.]+) per hour/i); | |
if(matches instanceof Array) { | |
rates[i].innerHTML = "$"+ Math.ceil(parseFloat(matches[1])*100*(365/12)*24)/100 + " per month"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment