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

Calculator not calculating correctly when using more than a single digit after decimal point #24611

Closed
AlphaVision opened this issue Mar 7, 2023 · 7 comments
Labels
Issue-Bug Something isn't working Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@AlphaVision
Copy link

Microsoft PowerToys version

0.68.0

Installation method

PowerToys auto-update

Running as admin

No

Area(s) with issue?

PowerToys Run

Steps to reproduce

When multiplying a number by another with a single digit (i.e. 0.3) after the decimal point all works ok, but when trying to multiply by a smaller number (i.e. 0.003) all zeroes after the decimal point are ignored and the results shown is as if a single trailing digit number was used.

Screenshot 7 3 2023 г  9_57_37

✔️ Expected Behavior

To calculate small floating point numbers i.e. 0.0004

❌ Actual Behavior

The zeroes after the decimal point are ignored and the number is converted to 0.4

Other Software

No response

@AlphaVision AlphaVision added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Mar 7, 2023
@Jay-o-Way
Copy link
Collaborator

Linking #2265. @crutkas @jaimecbernardo @htcfreek we need a fix for this asap. Don't want any buildings crashing down because PowerToys is responsible for bad calculations, or anything like that...

@jaimecbernardo
Copy link
Collaborator

@Jay-o-Way , perhaps we should make the "Use English (United States) number format for input" the default, since it seems that's how people expect it? 🤔

image

@Jay-o-Way
Copy link
Collaborator

Jay-o-Way commented Apr 24, 2023

@jaimecbernardo it's not about the decimal character. converts the fractional part into a number and the leading zero's get trimmed off.

@htcfreek
Copy link
Collaborator

@jaimecbernardo it's not about the decimal character. There is a fault in the Mages which converts the fractional part into a number and the leading zero's get trimmed off.

@Jay-o-Way
Is there an existing issue on the mages repo? If not we should open one that they can fix the bug.

@Jay-o-Way
Copy link
Collaborator

@jaimecbernardo and @htcfreek - we have been discussing this exact issue literally for years now. My commment above (blaming Mages engine) wasn't correct. See, Jaime, you explicitly mentioned the cause in #12375 (july 2021)

Every 0 after the dot on my comma-decimal system configurations seems to be ignored.
1.449*51.0000006 gives the same result (74,7684).
Even 1.0000449*51.0000006 gives the same result (74,7684).

I see that we're also translating the numbers between cultures 🤔 May be this is where the issue is.

I can confirm. Basically we're trying to translate numbers between cultures but then removing leading zeroes...

At the time I thought it was a bug in the engine. Now as I tried it again trying to prevent wrong inputs being sent to the engine I noticed that we're doing some number culture translation, and that's where this comes from. In this translation numbers like 59.06 are seen as two different numbers when . is not the decimal separator. So the numbers 59 and 06 are translated individually and replaced in the query, meaning 59.6 is passed to the engine.

@crutkas
Copy link
Member

crutkas commented Jul 31, 2023

/dup #2265

@microsoft-github-policy-service
Copy link
Contributor

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!

@microsoft-github-policy-service microsoft-github-policy-service bot added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Jul 31, 2023
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 Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

5 participants