Created
January 11, 2024 04:29
-
-
Save sdthornton/d801e90126c2c7da0f4a51ccf151b237 to your computer and use it in GitHub Desktop.
update-in
This file contains hidden or 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
function updateIn() { | |
let tr = $('td:contains("240112"), td:contains("240113"), td:contains("240114"), td:contains("240115")').parents('tr'); | |
let td = tr && tr.find('td:contains("$4")')[0]; | |
if (!window.hasUpdatedIns && tr && td) { | |
let price = td.innerText; | |
let newPrice = parseFloat(price.replace(/\$|,/gi, "")) - 85.76; | |
let [dollars, cents] = newPrice.toFixed(2).split("."); | |
td.innerText = "$" + Number(dollars).toLocaleString() + "." + cents; | |
window.hasUpdatedIns = true; | |
} | |
} |
Author
sdthornton
commented
Jan 11, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment