Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: currency conversion #44

Open
kaushikgopal opened this issue Apr 20, 2023 · 5 comments
Open

feature request: currency conversion #44

kaushikgopal opened this issue Apr 20, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@kaushikgopal
Copy link

Wonder if it's possible to add this. For e.g.

$100 to INR
@gtg922r gtg922r added the enhancement New feature or request label May 1, 2023
@gtg922r
Copy link
Owner

gtg922r commented May 1, 2023

Thanks for the suggestion!

Theoretically yes its possible to add, but two primary issues come to mind:

  1. I would need a source for up-to-date currency rates. In order to keep this plugin free that API would need to be free (and easily accessible). It also turns an otherwise offline plugin to an online one which I don't love, but perhaps is OK with user opt-in

  2. This would be the first function that has a dynamic result, which means the notes contents would change even if the user didn't change anything. Or it would mean that the data was out of data and technically wrong. This is the biggest issue for me as it leads to unpredictable results either way.

Issue 1 is possibly surmountable. 2 is a shift in the overall plugin philosophy.

I agree this would be a great feature, but due to these challenges, it's definitely further out on the roadmap.

@Mirsario
Copy link

Mirsario commented Sep 4, 2023

If anyone comes here looking for a workaround to use before this is implemented (or in case it won't be), MathJS' createUnit function allows overriding default units:

createUnit('EUR', '1.0801906 USD', { override: true, aliases: [ '€' ] })
createUnit('AUD', '0.64623444 USD', { override: true, aliases: [ 'A$' ] })

This was quite sufficient for me, one just has to remember to update conversion rates from time to time.
image

@filipstachura
Copy link

filipstachura commented Feb 23, 2024

Nice workaround @Mirsario, thank you.

I just want to add that an example of free and accessible API is one from the European Central Bank:
http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml

I believe that's the one that SoulverCore uses.

@gtg922r
Copy link
Owner

gtg922r commented Feb 24, 2024

@filipstachura / @Mirsario - any thoughts on my comment above?

This would be the first function that has a dynamic result, which means the notes contents would change even if the user didn't change anything. Or it would mean that the data was out of data and technically wrong. This is the biggest issue for me as it leads to unpredictable results either way.

Supporting @Mirsario's solution through a simple version of #47 avoids this issue of the values changing over time. Would it be a sufficient solution to support easy definition of static conversion rates that can be used and updated at user request?

@filipstachura
Copy link

I completely understand your point, and I think it's valid. Reproducibility is important. Your proposal has also clear advantage of straightforward User Experience when offline.

From the user perspective:

  1. easy definition of static conversion rates would work for me 👍
  2. it would be great to have a way to update it with current rates easily (from European Central Bank or elsewhere). Some ideas: (a) button next to definition to fetch current rates and/or (b) a shortcut to refresh directly from notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants