Marmo / debitum

free and libre IOU tracker for Android
GNU General Public License v3.0
85 stars 7 forks source link

Disable currency decimals option/setting #71

Closed Hattshire closed 2 years ago

Hattshire commented 3 years ago

My country doesn't have fractions of currency, so it's kind of annoying having add 2 extra zeros every time a new transaction is added 😔

Marmo commented 3 years ago

Sounds reasonable. Since the amount is stored as an integer internally, this shouldn't be too hard.

predator8bit commented 2 years ago

+1 I was thinking of opening an issue on this exact thing, just didn't get around to doing it before this was already here :)

Marmo commented 2 years ago

I am now working on this. I plan to allow 0 to 3 decimals, scrolling through this list, this should be sufficient.

One question is, how changing the number of decimals should affect existing data. I see two approaches here:

  1. Keep the internal value as is, effectively shifting the decimals separator (changing the setting from 2 to 1 decimals changes a transaction's amount of 123.45 to 1234.5)
  2. Try to keep the value shown to the user constant (changing the setting from 2 to 1 decimals changes a transaction's amount of 123.45 to 123.5) Caveat: this comes with loss of information: changing the setting back to 2 decimals will yield 123.50 which is not the original value.

I probably will ask the user what to do upon every change of the setting.

One more thing: this setting should be prominently advertised to the user upon first start.

Any thoughts?

predator8bit commented 2 years ago

I think rounding the numbers on change is fine. On the idea of a startup screen, it is fine as long as it only appears on the first startup after an update. Otherwise it would be an annoyance.

Marmo commented 2 years ago

Note to self: it is essential to implement #61 when releasing this, since restoring a backup in a fresh install could else cause the wrong amounts to be displayed (backed up with a setting other than 2 decimals, restoring before changing that setting from the default two of a fresh install)