User:Kiokurashi/common.js: Difference between revisions

From IdleOn MMO Wiki
imported>Kiokurashi
No edit summary
imported>Kiokurashi
(Blanked the page)
Line 1: Line 1:
function coindisplay(coins) {
 
    var n = coins;
    var ret = "";
    var imgs = ["4/43/Copper", "4/4e/Silver", "1/1f/Gold", "2/2c/Platinum", "5/53/Dementia",
    "d/d5/Void", "1/11/Lustre", "8/83/Starfire", "8/8b/Dreadlo", "e/e6/Godshard"];
    var i = 18;
    do {
        var expo = Math.pow(10, i);
        if (n > expo) {
            var num = Math.floor(n/expo);
                ret += "<img src=https://static.miraheze.org/idleonwiki/" + imgs[(i/2)] + "_Coin.png>" + num + " ";
            n = n % expo;
        }
        i -= 2;
    } while(i >= 0);
    return ret;
}

Revision as of 08:11, 13 October 2021