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

[Run][Calculator plugin] Wrong result when there are lots of decimal places #9309

Closed
prime167 opened this issue Jan 27, 2021 · 7 comments
Closed
Labels
Issue-Bug Something isn't working Product-PowerToys Run Improved app launch PT Run (Win+R) Window Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. Run-Plugin Things that relate with PowerToys Run's plugin interface

Comments

@prime167
Copy link

prime167 commented Jan 27, 2021

ℹ Computer information

  • PowerToys version: 0.29.3
  • PowerToy Utility: Run
  • Running PowerToys as Admin: Yes
  • Windows build number: 20H2 19042.746

📝 Provide detailed reproduction steps (if any)

  1. Press Alt+Space to open search box
  2. Enter 89/58.36, you can get answer 1.5250171350
  3. Continue to append 6
  4. When the input is 89/58.366666666666666666 (and more 6) the result becomes totally wrong

✔️ Expected result

1.5248429469

❌ Actual result

29.4075426386
75.3113975135
1187.3728567606
...

📷 Screenshots

image

@prime167 prime167 added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Jan 27, 2021
@prime167 prime167 changed the title Calculator pugin get wrong result when there are lots of decimal places [Run] Calculator pugin get wrong result when there are lots of decimal places Jan 27, 2021
@martinchrzan martinchrzan changed the title [Run] Calculator pugin get wrong result when there are lots of decimal places [Run] Calculator plugin gets a wrong result when there are lots of decimal places Jan 27, 2021
@crutkas crutkas added Product-PowerToys Run Improved app launch PT Run (Win+R) Window Run-Plugin Things that relate with PowerToys Run's plugin interface Run-Results (Programs) Issue with program search in PowerToys Run and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Jan 28, 2021
@crutkas
Copy link
Member

crutkas commented Jan 28, 2021

betting this is some type of mage issue with string to datatype. i don't know how much we'll be able to do here as we are string in, data out.

@crutkas crutkas removed the Run-Results (Programs) Issue with program search in PowerToys Run label Jan 28, 2021
@enricogior enricogior changed the title [Run] Calculator plugin gets a wrong result when there are lots of decimal places [Run][Calculator plugin] Wrong result when there are lots of decimal places Feb 27, 2021
@htcfreek
Copy link
Collaborator

betting this is some type of mage issue with string to datatype. i don't know how much we'll be able to do here as we are string in, data out.

@crutkas
This is not correct. We do conversation from double to decimal. But I think you are correct that the overflow cause is within mages or better said that mages uses double instead of decimal. (Decimal is more precise.)

I can check if this can be configured in mages.

@crutkas
Copy link
Member

crutkas commented May 30, 2022

What line? If I remember correctly we pass in a string to their engine. Data types is up to them

@htcfreek
Copy link
Collaborator

htcfreek commented May 30, 2022

What line? If I remember correctly we pass in a string to their engine. Data types is up to them

var decimalResult = Convert.ToDecimal(result, cultureInfo);

The problem is that we can't tell mages to use decimal. But we could check if the rounding code in our class works correct.

Btw. I can reproduce a overflow in the plugin that makes number incorrect. If you input for example =0.5555555555 and much more decimal digits after the point there will be some point where the result becomes different to the input.

And please have in mind that there is a PR awaiting review that fixes many bugs in the calc plugin: #18159

@htcfreek
Copy link
Collaborator

htcfreek commented Jun 2, 2022

/dup #18574

@ghost
Copy link

ghost commented Jun 2, 2022

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost ghost closed this as completed Jun 2, 2022
@ghost ghost added the Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. label Jun 2, 2022
@ghost
Copy link

ghost commented Jun 2, 2022

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working Product-PowerToys Run Improved app launch PT Run (Win+R) Window Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. Run-Plugin Things that relate with PowerToys Run's plugin interface
Projects
None yet
Development

No branches or pull requests

3 participants