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

Add additional rate that cannot be obtained from API #39

Closed NirvanaPhX closed 3 years ago

NirvanaPhX commented 3 years ago

Hi,

I am trying to include the Ethereum price which is not included in the free version of the Open Exchange Rate API rate. I think I might be able to make some modifications to make it work. So I added a function in the money.js as follow: var append = fx.append = (key, value) => { fx.rates[key] = value } And in my main.js: fx.rate['ETH'] = 0.00061; However, this doesn't work. It would be great if anyone can point me a way out. Sorry, I am new to JS too. Thanks.

NirvanaPhX commented 3 years ago

Never mind. Found a way around.