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

[Regression] Fractions are being converted to decimals #89

Closed
TinfoilSubmarine opened this issue Aug 5, 2024 · 1 comment · Fixed by #94
Closed

[Regression] Fractions are being converted to decimals #89

TinfoilSubmarine opened this issue Aug 5, 2024 · 1 comment · Fixed by #94
Labels
bug Something isn't working

Comments

@TinfoilSubmarine
Copy link

TinfoilSubmarine commented Aug 5, 2024

Describe the bug

All fractions in ingredients list are being converted to decimals.

To Reproduce
Steps to reproduce the behavior:

  1. Have recipe with fractions (such as 1/2, 2/3, etc.).
  2. When viewing recipe, see that a decimal is displayed.

Expected behavior

When viewing recipe, if a fraction is input for the ingredient, a fraction should be displayed.

Screenshots

Screenshot_20240805-120840_Cookbook
Screenshot_20240805-120847_Cookbook

Smartphone:

  • Device: Pixel 5
  • OS: LineageOS 21 (Android 14)
  • Version: 0.20.1

Additional context

Not everyone can intuit that e.g. 0.12 ~= 1/8 very quickly. I understand that there are probably some technical issues with doing this if the user changes the serving amount, but at least for the original recipe serving amount, we should display the recipe as it was input by the user.

EDIT: Upon further investigation, this appears to be a regression from version 0.18.0 which displayed the fractions as expected.

@TinfoilSubmarine TinfoilSubmarine added the bug Something isn't working label Aug 5, 2024
@TinfoilSubmarine TinfoilSubmarine changed the title Fractions are being converted to decimals Regression: fractions are being converted to decimals Aug 5, 2024
@TinfoilSubmarine TinfoilSubmarine changed the title Regression: fractions are being converted to decimals Fractions are being converted to decimals Aug 5, 2024
@TinfoilSubmarine TinfoilSubmarine changed the title Fractions are being converted to decimals [Regression] Fractions are being converted to decimals Aug 5, 2024
@lneugebauer
Copy link
Owner

Hi @TinfoilSubmarine, thank you for reporting this issue.

I decided to always use the calculated amounts as this is the same behaviour the webapp has.
In general, I try to mimic the behaviour of the webapp to have as seamless an experience as possible between the two.

There was a big discussion about how to implement the calculation behaviour and I didn't wanna go against that. It looks like this is going to change though, as there is an open PR (nextcloud/cookbook#2421). I'll get in contact with the developers and figure out the state of that PR.

It looks like porting that would also resolve #84.

But I understand your point. Being limited to decimals doesn't feel right.

lneugebauer added a commit that referenced this issue Sep 14, 2024
@lneugebauer lneugebauer linked a pull request Sep 14, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants