0
0
mirror of https://github.com/Maks1mS/userscripts.git synced 2024-12-23 16:22:59 +03:00

[SteamPriceConverter] update to 0.3

- add timeout and source price viewing (#1)
This commit is contained in:
KaMZeSs 2024-06-22 23:23:29 +03:00 committed by GitHub
parent 32a4239fe4
commit db9d93407d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,7 @@
// ==UserScript==
// @name Steam Price Converter
// @namespace https://github.com/Maks1mS/userscripts
// @version 0.2
// @version 0.3
// @description Converts prices to rubles
// @author Maxim Slipenko
// @match https://store.steampowered.com/*
@ -62,6 +62,8 @@
return;
}
setTimeout(75);
const convert = (n) => +(n * rates[source_valute].value).toFixed(2);
replace(convert);
@ -74,7 +76,8 @@
for (let i = 0; i < r.snapshotLength; i++) {
let n = r.snapshotItem(i);
const value = parseFloat(n.textContent.replace(" ", "").replace(',', '.'))
n.replaceWith(`${convert(value)}`);
n.replaceWith(`${convert(value)} ₽ / ${value} ${state.source_symbol}`);
console.log(n)
}
}