ebcrowder / rust_ledger

Rust implementation of ledger, the command line accounting tool.
GNU General Public License v3.0
137 stars 19 forks source link

Support of different currencies #18

Closed dshemin closed 4 years ago

dshemin commented 4 years ago

Hi!

Maybe I'm wrong but as far as I see for now rust_ledger doesn't support different currencies. So I think this fefature is essential and I can try to add basic support of multiple currencies but I think it should be discussed 'cause may affect whole application.

For now I see one big problem - conversion between different currencies 'cause ration maybe changed very often and the time when users add transaction is not the time when they spent their money so ration will be different. So for simplicity we may add a currency field into the rledger file and usesr can select base currency for their wallet. It's important for me 'cause I leave in Russia and use the ruble and it's pretty strange to see that I'm a millioner (we have an awful ration between ruble and USD) 😅.

That do you think about that?

dantuck commented 4 years ago

The first update of rust_ledger did not have a currency concept until monee (https://gitlab.com/dantuck/monee) was introduced to solve the basic problems. The first implementation was in USD and flexibility was left to allow for other currencies. One thing I have not thought about yet is the exchange rate constantly changing which would lead to some issues if you are constantly converting between currencies or waiting to see the exact exchange at the time of the conversion by your bank or other institution. That problem would definitely need to be thought through a little more if that scenario is something that you would be running into.

If you would like to extend monee to cover your currencies please do. Your contributions will be greatly appreciated. Additionally you will get the benefit of not being perceived as a millionaire ;)

After any changes are pushed to crates.io we will then need to enhance rust_ledger to allow for the default selected currency as you suggested.