Last active
March 24, 2022 21:42
-
-
Save aasmpro/9e087895d072c5b4428a71b247adb2a4 to your computer and use it in GitHub Desktop.
A script to convert prices to another one on numbeo.com. simply just open the console, copy, paste and enter!
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
let currency_symbol = "IRT"; | |
let currency_ratio = 30; | |
let convert = (value) => {return (parseFloat(value.replaceAll(',',''))*currency_ratio).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}; | |
let price_elements = document.getElementsByClassName("first_currency"); | |
Array.prototype.map.call(price_elements, (item) => {item.innerHTML = `${convert(item.innerHTML.match(/[\d,]*[.]{0,1}[\d]+/g)[0])} ${currency_symbol}`;}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for example, open the Munich page on Numbeo.com and enter open console with F12 and copy/paste this script to convert Euro prices to Iran Toman (1 euro = 30 Toman)