Skip to content

Instantly share code, notes, and snippets.

@StoneCypher
Created July 5, 2014 10:33
Show Gist options
  • Select an option

  • Save StoneCypher/922fe8d8e46f1fdfee04 to your computer and use it in GitHub Desktop.

Select an option

Save StoneCypher/922fe8d8e46f1fdfee04 to your computer and use it in GitHub Desktop.
var Pricers = {
"us": { cur: "$", price: function(Slots) { return (Slots*10)+10; } },
"ru": { cur: "E", price: function(Slots) { return Slots*0.5; } }
};
function curFmt(Cur, X) { return Pricers[Cur].cur + X.toString(); }
function price(Cur, Amt) { return curFmt(Cur, Pricers[Cur].price(Amt)); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment