-
Notifications
You must be signed in to change notification settings - Fork 48
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
Remove "approx." keyword and improve decimal point/comma handling #70
Conversation
…d forced reset to decimal dots instead of commas when needed
Thank you for the PR! |
We also want to consider Pop!_OS 20.04 LTS as well as other distributions. It looks like this is still happening in 20.04 LTS, so we do want to review the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nathansgithub Your issue #71 indicated this should use a ≈ symbol instead of the word "approx." I don't see that ≈ symbol present, and it seems like there should be some indication when the result isn't exact. Do you know why that isn't showing?
Oh, I see, you were saying the ≈ is stripped the same was a = currently is. I think this would be a good change, if we can get the ≈ to show up in the result visually. |
@jacobgkau Yeah, I meant it uses the ≈ symbol behind the scenes. Do you think it's important to distinguish an approximate result, and how would you want to do that? I do want to keep the use case where you can hit return and immediately use the previous result as part of a new calculation (and that's the main reason I suggested this change). |
100% agreed on that point, that is an intended feature.
It does seem important. I would think just having If making the launcher treat |
@jacobgkau I think this fixes it. It will leave the ≈ in front of approximate results but keep the same behavior for other results. The existing code already filters out ≈ before the value is sent to the Fill() function that fills the search field. |
…ng for equals sign
I upgraded my system to 21.10 and noticed some changes in qalc's formatting, so I added a couple changes to the code.
|
@jacobgkau Let me know if there's anything else you want me to change. I think this PR will make the results clearer on both 21.10 and 20.04. Right now, the equation 7/6 resolves to: This change will make it so the answer on both is just Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
21.10: working as expected. Querying 2/3
returns ≈ 0.666666667
, pressing Enter on that result pre-fills = 0.6666666667
, and from there, continuing to press Enter cycles between that and 6666666667/10000000000
.
On 20.04 LTS, the behavior now looks nearly identical, only (due to the older Qalculate! version) the decimal is not converted back to a fraction, so the decimal is as far as the results can go without modifying the query again:
Other calculations are still being solved as expected. This change looks good to me.
Awesome, thank you! |
This changes the calculator behavior to stop showing "approx." in front of numbers when it has more decimal places than can be shown, by enabling qalc's Unicode support. It also explicitly sets the decimal mark to decimal points when that's preferred over commas.
For issue #71