NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name gaia trade window amount verifier // @namespace kittyfluff // @version 0.14 // @match *.gaiaonline.com/gaia/* // ==/UserScript== // reformatting gold values on trade-pages var goldBox = document.getElementsByClassName("gold-input"), numWords = ["thousand", "million", "billion", "trillion", "quadrillion", "quintillion"], val = "", segments = [], decValue = 0, item = 0; for (item = 0; item < goldBox.length; item++) { if (goldBox[item].disabled) { goldBox[item].style.width = "300px"; val = goldBox[item].value.replace(/\B(?=(\d{3})+(?!\d))/g, ","); segments = val.split(","); if (segments.length > 1) { decValue = segments.shift(); val += " (" + decValue + " " + numWords[(segments.length - 1)] + ")"; } goldBox[item].value = val; } }