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

[Bug]: Apply Templates will budget non-whole numbers when decimal places are hidden #3846

Open
2 tasks done
Teprifer opened this issue Nov 17, 2024 · 2 comments
Open
2 tasks done
Labels
bug Something isn't working goal templates Related to the experimental goal templates feature

Comments

@Teprifer
Copy link

Verified issue does not already exist?

  • I have searched and found no existing issue
  • I will be providing steps how to reproduce the bug (in most cases this will also mean uploading a demo budget file)

What happened?

From Discord: https://discord.com/channels/937901803608096828/1306841659493060628

If templates are applied while the hide decimal places user setting is enabled, a non-whole number can be budgeted via Apply Templates.

Steps to reproduce:

  1. Setup a test budget
  2. If using an existing category, zero out what is budgeted so it's easier to see.
  3. Enable the hide decimal places option on the settings page
  4. Enable goal templates
  5. Set a template to a category to #template 1517 by 2025-10 (or anything that'll result in the amount per month not to be a whole number)
  6. Apply budget template
  7. Disable the hide decimals setting
  8. Review the category budgeted amount and note it budgeted after the decimal place

Expected result, when hide decimals is enabled, templates only budgets whole numbers. This is a bug because currencies without decimal places can't realistically budget with decimal places and can result in their budgeted values not balancing (visually).

With decimals hidden this looks like:
image

When re-showing decimals it shows what it actually did:
image

If someone hides decimals even though they do have a currency with them, this change would have a negligible effect anyway of up to +/- 1 until the last month.

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Firefox

Operating System

Windows 11

@Teprifer Teprifer added the bug Something isn't working label Nov 17, 2024
@youngcw
Copy link
Member

youngcw commented Nov 17, 2024

I think that in order to have the math not break things like priorities, there should be a round stage at the end of each processing stage, if this setting is enabled. It shouldn't be overly difficult to add. I do worry that the templates will be off by 1 sometimes, but we would have to test and see.

@Teprifer
Copy link
Author

I think that in order to have the math not break things like priorities, there should be a round stage at the end of each processing stage, if this setting is enabled. It shouldn't be overly difficult to add. I do worry that the templates will be off by 1 sometimes, but we would have to test and see.

Ah yep, I think in most cases it should be fine overall - it would only affect the templates where actual is doing the maths, and would even out over time. It would still result in the correct end balance in the last month right?

I'd imagine it's quite similar to how cents must be rounded for decimal currencies.

@youngcw youngcw added the goal templates Related to the experimental goal templates feature label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working goal templates Related to the experimental goal templates feature
Projects
None yet
Development

No branches or pull requests

2 participants