You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I hope this project is still maintained... It doesn't really look like it is though.
When using the lib in node, it is not possible to use different rates at different places.
This is due to the fact that the module is a singleton.
I suggest a method to get a fresh instance of fx on which different rates could be set.
It could work like this:
var fx = require('money');
// Global settings
fx.base = 'EUR';
fx.rates = { 'USD': 0.9 };
// convert using the global settings
var myVerySpecialMethod = function () {
var myLocalFx = fx.clone();
// these settings are only applied to that local instance
myLocalFx.base = 'CHF';
myLocalFx.rates = { 'USD': 2.5 };
// convert using the local settings
};
This way the current API would still work.
The text was updated successfully, but these errors were encountered:
I hope this project is still maintained... It doesn't really look like it is though.
When using the lib in node, it is not possible to use different rates at different places.
This is due to the fact that the module is a singleton.
I suggest a method to get a fresh instance of
fx
on which different rates could be set.It could work like this:
This way the current API would still work.
The text was updated successfully, but these errors were encountered: