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

[PTRun][Calculator]Always accept decimal point #16980

Conversation

jaimecbernardo
Copy link
Collaborator

Summary of the Pull Request

What is this about:
Users expect to be able to use decimal points . in Calculator, even if their system is configured with another decimal separator character.
Our translation of the user current locale into Mages numbers removes leading zeroes, leading to some calculation errors as can be seen in the linked issue.

What is included in the PR:
Accept . as part of the number before translation, so that we don't end up removing leading zeroes from the decimal point of a number the user expects to work well.

How does someone test / validate:
In a locale without . as either the decimal serparator or number group separator, try to use numbers with .0 in the decimal part and verify the calculation is correct.
For example, 1.449*51.06 should result in 73.98594 and not 74.7684.

Quality Checklist

Contributor License Agreement (CLA)

A CLA must be signed. If not, go over here and sign the CLA.

Copy link
Contributor

@yuyoyuppe yuyoyuppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change seems to be reasonable, LGTM

Copy link
Collaborator

@SeraphimaZykova SeraphimaZykova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jaimecbernardo jaimecbernardo merged commit 1f64c1c into microsoft:main Mar 11, 2022
htcfreek added a commit to htcfreek/PowerToys that referenced this pull request May 22, 2022
jaimecbernardo pushed a commit that referenced this pull request Jun 2, 2022
* crash fixes and error result

* small changes and test fixes

* improve exceptions and message

* double array crash fix

* overflowexception

* improve error handling

* varous improvements

* varous improvements

* fix spelling

* fix spelling

* Revert #16980

* add description

* error improvemenet

* Update tests

* spelling fixes

* small changes

* add settings

* last changes

* fix description

* update dev docs

* spell check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants