openexchangerates / money.js

money.js is a tiny (1kb) javascript currency conversion library, for web & nodeJS
http://openexchangerates.github.io/money.js
MIT License
1.46k stars 127 forks source link

Extend chaining method names to include `base` and `quote` #6

Open wjcrowcroft opened 12 years ago

wjcrowcroft commented 12 years ago

In money.js, you can chain methods like this:

fx(1000).from("EUR").to("USD"); // 1.2945

These could be aliased as base and quote, for consistency with the naming convention in currency pairs and exchange rate calculations

So they would also be available like this:

fx(1000).base("EUR").quote("USD"); // 1.2945

But only if it doesn't bloat the code too much.