microsoft / calculator

Windows Calculator: A simple yet powerful calculator that ships with Windows
MIT License
29.49k stars 5.34k forks source link

Automatic scientific notation can't be disabled #226

Open uhliksk opened 5 years ago

uhliksk commented 5 years ago

Describe the bug In scientific mode scientific notation can be enabled by F-E button but can't be disabled if number have more than 2 zeros after decimal point. This automatic scientific notation is also enabled even on standard mode. Sometimes it's more useful and more readable if number stay in common decimal format instead of scientific notation. For example while calculating crypto currencies it is more useful to see 0.000005142857 where I can easily see 514 satoshi price than 5.142857e-6.

Steps To Reproduce

  1. Switch to standard or scientific mode
  2. Type 0.000036
  3. Press divide symbol
  4. Type 7
  5. Press Enter
  6. Pressing F-E is not changing output format

Expected behavior

Other behaviors considered:

  • Stay in normal decimal format until I press F-E to switch to scientific notation OR
  • Show scientific notation but also enable F-E switch to indicate scientific notation mode with ability to disable F-E to show number in common decimal format OR
  • Add another switch to enable/disable automatic scientific notation if number conains more than defined number of zeros after decimal point OR
  • Disable automatic scientific notation in standard mode calculator at all and add another switch to enable/disable automatic scientific notation in scientific mode if numbers contains more than defined number of zeros after decimal point OR
  • Add settings for automatic result rounding or display precision to any number of digits to prevent automatic scientific notation to trigger just because result contain lot of digits after decimal point which are not important for user

Device and Application Information (please complete the following information):

Note: A team member edited this comment for clarity on expected behavior

uhliksk commented 5 years ago

Another real life example:

Bitcoin price is 3478.90 €/BTC. How many BTC I'll get for 1€?

  1. Switch to standard or scientific mode
  2. Type 1
  3. Press divide symbol
  4. Type 3478.9
  5. Press Enter

Result is 2.8744718158e-4 which is hardly readable for me. I expect to see 0.00028744718158 to better understand visually how many decimals are there.

Luuk34 commented 5 years ago

0.000036/7 = 5,1428571428571428571428571428571e-6 This has too many decimals for the 'F-E' button to work correctly.

If you copy the result, paste it in notepad, and remove some decimals to have 25 decimals like: 5,1428571428571428571428571e-6 When you copy/paste this to calculator, the 'F-E' button works.

uhliksk commented 5 years ago

Then settings for automatic result rounding should be solution. For example acountants don't need 32 digits precision for prices and other financial calculations. For them it is really annoying to see more than 2 or 4 digits. Same for cryptocurrencies where anything under 1 sathoshi is not imporant for Bitcoin. I'll add that solution to expected behavior.

MicrosoftIssueBot commented 5 years ago

This is your friendly Microsoft Issue Bot. I've seen this issue come in and have gone to tell a human about it.

HowardWolosky commented 5 years ago

@grochocki -- Can triage weigh in on this app behavior change (especially given that there is currently a PR linked to this untriaged Issue). Thanks.

grochocki commented 5 years ago

I think the desired behavior here is a combination of a couple of your suggestions.

@uhliksk I am going to update your original issue for clarity on expected behavior.

danbelcher-MSFT commented 5 years ago

It's not clear now what should happen in Standard mode for values that used to only be displayable with scientific notation. For example, in Standard mode, if I input 100,000,000 * 100,000,000, I get 1.e+16, which is correct. I can continue to perform operations on this value. After the change that is proposed, the result is simply Overflow.

Overall, this change would make it so that there is a large class of numbers we can compute in Standard mode, but we will bail out and tell the user we can't compute because we don't want to display scientific notation. It feels regressive compared to the current behavior.

grochocki commented 5 years ago

It's not clear now what should happen in Standard mode for values that used to only be displayable with scientific notation. For example, in Standard mode, if I input 100,000,000 * 100,000,000, I get 1.e+16, which is correct.

Scientific mode is better suited for dealing with very large and very small number, but I agree that showing overflow in this case is not ideal. In #162, I proposed supporting 32 digits across both Standard and Scientific modes (instead of just 16 in Standard as we do today). While this would not fully address your concern (eventually, you will hit large enough numbers to still cause overflow), it does greatly extend the range of values we support before getting into that state. Perhaps that change can/should coincide with this fix.

MovGP0 commented 5 years ago

engineering notation can be helpful in such cases. ie.

0.000036/7

results in

5.142,857 • 10-6

which is easier to comprehend and still compact.

grochocki commented 5 years ago

Compact is not necessarily the goal as we do not want to lose precision. Today we display 5.142857142857143e-6, which is 5.142,857 • 10-6, but with greater precision.

j9brown commented 4 years ago

I'm having the same issue here. As a user, I find it frustrating that the calculator won't show me simple decimal numbers even in Standard mode. I can certainly read scientific notation but it takes more thought.

It's baffling why 1/10000 shows 0.00001 whereas 1/2950 shows 3.389830508474576e-4. I was trying to estimate the period of a signal in microseconds, so 0.0003898... would have been much more intuitive at a glance.

MovGP0 commented 4 years ago

I was trying to estimate the period of a signal in microseconds, so 0.0003898... would have been much more intuitive at a glance.

I think that the engineering presentation of 389.8 μs would have been even more intuitive.

uhliksk commented 4 years ago

I was trying to estimate the period of a signal in microseconds, so 0.0003898... would have been much more intuitive at a glance.

I think that the engineering presentation of 389.8 μs would have been even more intuitive.

Then it'll be more intuitive to show 389.8e-6 instead of 3.898e-4. I can create another Issue and PR to add option for exponents to be divisible by 3 (or another customizable value).

anishkgt commented 4 years ago

So is there is fix for this 'e' issue ?

brunorcabral commented 4 years ago

I am also interested in a fix. If the user wants standard, give standard, if user wants scientific, give scientific. I want standard so I can copy and paste to another file that doesn't accept scientific.

grochocki commented 4 years ago

1304 should provide us the UI affordance to toggle auto scientific notation off. I suggest we address this issue as part of implementation of #1304.

scotthibbs commented 3 years ago

PLEASE PLEASE fix this. As a user, if I wanted a precise scientific notation, I would have switched to a precise scientific notation calculator... as a simpleton, why do I need to do more math after entering the math that I wanted done by my calculator???? How do I enter a times e-6 to get the 5.142857 to display to the display limit of the calculator.. 10 digits? 8 digits? If the reading is 0.0000000001, it's fine with me. If I wanted a more precise measurement of relatively nothing, I'd have switched to the scientific mode. I switched to the currency mode expecting 2 digits but the calc switched number layout to 10 key minus any functions... I'm not in tablet mode and touch screens are for toddlers and maybe or maybe not I actually have a number pad on my keyboard... But no.. I got a e-6 number and a horrible calculator on my pc.

How about asking the user how many decibels to display?

TomArrow commented 3 years ago

Agreed, this would be a good fix. Very annoying.

TheBEAST8 commented 3 years ago

I would also love a solution to this issue. It is so annoying having to figure out how many zero's I need to have before the mess of numbers that fill my screen. Scientific notation is useful but not all the time, in fact for me it's very rare that I do use it. The calculator on Windows should allow us to toggle between in modes otherwise it renders this calculator useless honestly. I won't be using it till this issue is fixed!!!

ggavaghan commented 3 years ago

If you all are waiting for Microsoft to fix this, you might as well go buy an Abacus. It is just a calculator after all, and Microsoft is not exactly known for it's ingenuity nor user-responsiveness. Just go download one of the 100's of replacements available on the web. Plenty of developers have already made far superior calculators than anything Microsoft is capable of (at least unless/until they buy one out, which would probably be faster than fixing their own code).

mmortal03 commented 3 years ago

Just go download one of the 100's of replacements available on the web. Plenty of developers have already made far superior calculators than anything Microsoft is capable of (at least unless/until they buy one out, which would probably be faster than fixing their own code).

Why not both?

lukapercic commented 3 years ago

still no fix?

coinfork commented 3 years ago

This is frustrating and would be great to see fixed!

crawsome commented 2 years ago

Bump

Alan-Steadman commented 2 years ago

Microsoft are f*ing w**ers who never fix ANYTHING.

Bug creators? Yes muchly.

Bug fixers? NO

How many f***ing years old is this issue? What have they done about it? What's the purpose of even having this page here? Just to wind us up???
c##ts.

Alan-Steadman commented 2 years ago

Microsoft. The biggest, most valuable, most cash-rich software company in the history of the world.

Do not have it within their capacity or their capability to fix a simple problem (decimal points) in the most simple program (calculator).

dexyfex commented 2 years ago

The F-E button does nothing. Why are you so concerned about precision anyway? And why would you lose precision by doing this? You can still preserve the same number of significant figures, the overall number would just be longer, although there could be issues with very large exponent. This is just a matter for the part that is converting the number to a string, there should be no precision loss in it?

ggavaghan commented 2 years ago

The F-E button does nothing. Why are you so concerned about precision anyway? And why would you lose precision by doing this? You can still preserve the same number of significant figures, the overall number would just be longer, although there could be issues with very large exponent. This is just a matter for the part that is converting the number to a string, there should be no precision loss in it?

(1) Asking someone who is using a calculator to compute a value "Why are you so concerned about precision anyway?" is a pretty non-sensical question. If they didn't care about precision, they would just guestimate it rather than using a calculator.

In my case, one of the things I deal with is counting Photons on the nano-second time scale, as well as all of the timing values that go with that, so precision is pretty important to me. Maybe you are using it to ball-park a value, but most people would prefer the exact, correct, and complete answer.

(2) The F-E button changes how the values are displayed. Depending on many digits (and zeros to the left) the value currently being displayed has, it can either :

  1. Toggle between SN and 'normal' display
  2. (if already in SN) rounds the SN to X decimal places (X is not a fixed number in my experience. Today I've seen 20 and 28)

As for the loss in precision, I grant you that MS is listing the SN value to include 20, 30, (more?) digits, but that is NOT how SN is supposed to work, and it STILL rounds values with "too many" decimals. As far as I understand it, SN syntax generally only has a few decimal places included, and is best used to represent values with Zeros to the right OR many digits to the left of the decimal, like 0.000125 (1.25E+4) or 123456789 (1.235E-8). Using it on a value with Integer digits (or not) plus lots of decimals (with or without zeros to the right) is an exercise in stupidity because the SN version is actually longer, and if anything is harder to read, not easier ("How many places do I need to shift that decimal to get my real value?"). Try toggling the F-E button on the value for Pi to see what I mean.

I think the original point of this thread was that SN is not suited to all circumstances or use-cases, and it would be nice if it was not forced upon us, especially when there is NO GOOD REASON for it. But like I've said in previous posts (that mysteriously get 'hidden' as "off topic"), If you are waiting for MS to fix this, you are in for a very long wait. But I don't dare point you at another calculator program that works correctly, because it might upset someone at MS. (They don't like it when other people point out how to fix (or side-step) their failures. They would much rather you just suck it up like a good little user and let them fix it when and if they get around to it).

To Microsoft: If you need some help, just send me your code and I will fix it for you, pro-bono. You can even say you fixed it.

P.S.: I can't help myself : Go get SpeedCrunch. It'll give you 50 decimal places and control over the format.

Alan-Steadman commented 2 years ago

I'd just like to copy/paste values from a calculator. Come on microsoft, sort your sh*tty calculator out.

Alan-Steadman commented 2 years ago

... and stop wasting ^ all these ppl's time commenting on your crappy product

??? So there is someone here moderating the comments, but no fkkr doing anything about fixing the calculator??? Microsoft ALL OVER

ggavaghan commented 2 years ago

I'd just like to copy/paste values from a calculator. Come on microsoft, sort your sh*tty calculator out.

Hi Alen - if the Calculator has focus, just hit Ctrl+C and it'll copy the current answer to the clipboard. Pasting into the Calculator works the same way - make sure the Calculator has focus and hit Ctrl+V. (I guess MS hasn't gotten around to breaking that feature yet, use it while you can!).

Alan-Steadman commented 2 years ago

I'd just like to copy/paste values from a calculator. Come on microsoft, sort your sh*tty calculator out.

Hi Alen - if the Calculator has focus, just hit Ctrl+C and it'll copy the current answer to the clipboard. Pasting into the Calculator works the same way - make sure the Calculator has focus and hit Ctrl+V. (I guess MS hasn't gotten around to breaking that feature yet, use it while you can!).

Thanks, but it still copies the E notation, as per the display.

Come on microsoft you bunch of useless dullards, FIX YOUR CRAP.

ggavaghan commented 2 years ago

Thanks, but it still copies the E notation, as per the display.

Come on microsoft you bunch of useless dullards, FIX YOUR CRAP.

DOH! Didn't try that, but I should have figured.

lukapercic commented 2 years ago

Can you guys suggest some better open-source calculators for windows? Microsoft clearly doesn't care about any of this stuff, we might help each other find a better alternative.

dexyfex commented 2 years ago

The F-E button does nothing. Why are you so concerned about precision anyway? And why would you lose precision by doing this? [...]

(1) Asking someone who is using a calculator to compute a value "Why are you so concerned about precision anyway?" is a pretty non-sensical question. If they didn't care about precision, they would just guestimate it rather than using a calculator.

Sorry I wasn't really clear with that precision comment and I can see it's been misunderstood here. I was trying to make a point that precision really shouldn't be any concern when just pressing the F-E button because it should just be changing the text representation of the number, not the number itself...

ggavaghan commented 2 years ago

Sorry I wasn't really clear with that precision comment and I can see it's been misunderstood here. I was trying to make a point that precision really shouldn't be any concern when just pressing the F-E button because it should just be changing the text representation of the number, not the number itself...

Hi dex- Point taken and understood (I think). The "shouldn't" part is what was missing.

It shouldn't matter because it should preserve the precision (as much as is possible) and simply change the format. Problem is, the MS Calculator changes the number of decimals displayed using some black-box logic that I just can't seem to figure out. For one value (when hitting F-E) it might show me 20 decimals from SN, while on the very next value it will show me 28 decimals for SN. Both values actually had > 50 decimals to start with (proven using SpeedCrunch), but the SN produced by MS Calc contains an inconsistent number of decimals, and hence, precision.

ggavaghan commented 2 years ago

Can you guys suggest some better open-source calculators for windows? Microsoft clearly doesn't care about any of this stuff, we might help each other find a better alternative.

Hi lukapercic - I am currently using SpeedCrunch. It can do up to 50 decimals without SN. But be warned - it does not appear to have been touched in about 15 years. (So about the same amount of time since MS made their last fix - lol).

SpeedCrunch website: https://speedcrunch.org (for the installer) On GitHub: https://github.com/ruphy/speedcrunch (for the source)

Happy crunching!

ITGUYHPH commented 2 years ago

Can you guys suggest some better open-source calculators for windows? Microsoft clearly doesn't care about any of this stuff, we might help each other find a better alternative.

Hi lukapercic - I am currently using SpeedCrunch. It can do up to 50 decimals without SN. But be warned - it does not appear to have been touched in about 15 years. (So about the same amount of time since MS made their last fix - lol).

SpeedCrunch website: https://speedcrunch.org (for the installer) On GitHub: https://github.com/ruphy/speedcrunch (for the source)

Happy crunching!

Looks like they fixed this in Windows 11. It's not a setting but you do get the leading zeroes in the Scientific mode of the calculator. That's actually where I'd expect to see exponential format and zeroes in the standard one but at least there's a way now. they should have just made it a setting to toggle in Standard mode.

ggavaghan commented 2 years ago

Looks like they fixed this in Windows 11. It's not a setting but you do get the leading zeroes in the Scientific mode of the calculator. That's actually where I'd expect to see exponential format and zeroes in the standard one but at least there's a way now. they should have just made it a setting to toggle in Standard mode.

So.....instead of just getting an alternate calculator, all I need to do is subject myself to another [1,2, 3, ???] years of patches, service-packs, and random changes to how, what, and where things are stored before having a (hopefully) stable OS again? Sweet!!!

@ITGUYHPH - no offence towards you is intended. It appears you are just trying to clue people in on this little tidbit of information. My angst is 110% towards MS who's MO is BS - "Why correct something you can charge for in the next version!"

ITGUYHPH commented 2 years ago

I get it. I don't use windows much at home, especially not the calculator. We use it at work and upgrade pretty soon after it's stable. if you've found an alternative that's safe and featured in the app store please let us know. yeah I'm just trying to clue people in. it's super frustrating. I end up using website calculators in win10 because of this feature alone.

n9jcv commented 2 years ago

I gave up and now use my Android phone to do it. Here was my example - real life I am trying to calculate the amount of current flowing in a simple circuit. Using Ohms law I = V/R Current = Voltage divided by resistance units - Current Amps, Voltage Volts and Resistance Ohms I did this on the Windows Calculator 4.1(V) divided by 15000(ohms) equals
and MS gives me this 2.733333333333333e-4

Thank YOU but that is not helpful at all. I was expecting to see a very small portion of 1 Amp I was expecting .0002 but instead you think I care to see 2.733333333333333e-4

Just give us a little button to disable the Scientific notation in standard mode.

adam-waite commented 2 years ago

Looks like they fixed this in Windows 11. It's not a setting but you do get the leading zeroes in the Scientific mode of the calculator.

Isn't that just classic Microsoft? Not only have they refused to implement a simple fix, they actually implemented the opposite of what was requested!

Bumping this thread because this is annoying and should be an easy fix, but then again this issue has been open for 3 years without any attention from developers.

To be clear, the request is: in the standard mode of the calculator, avoid using scientific notation. In the scientific mode of the calculator, use scientific notation.

Luuk34 commented 2 years ago

To be clear, the request is: in the standard mode of the calculator, avoid using scientific notation. In the scientific mode of the calculator, use scientific notation.

It says avoid, It does not say: "do not use". When any number should be displayed and scientific notation is the only option, because standard notation is not possible, then do so.

destroy commented 1 year ago

Omg, no fix yet? Even google calculator can do it! What a shame.

Alan-Steadman commented 1 year ago

this is Microsoft all over

SkybuckFlying commented 1 year ago

Sciencetific mode in windows 7 calculator is super annoying. Is there a way to disable it ?!

Luuk34 commented 1 year ago

Sciencetific mode in windows 7 calculator is super annoying. Is there a way to disable it ?!

Yes, you can upgrade you windows version, and still have the same problem.

DmitriiShamrikov commented 1 year ago

I can't belive that you can't fix a goddamn calculator for 4 years

ggavaghan commented 1 year ago

I can't belive that you can't fix a goddamn calculator for 4 years

Clearly you haven't dealt with Microsoft very much. 4 years is just how long this particular ticket has been open. The problem has been around a lot longer than that. Further, if you are surprised that MS hasn't done anything about it, all I can say is ROFLMAO.

This problem will only go away when/if they steal acquire the code for another calculator from someone else.

Joachim-Otahal commented 10 months ago

2023 November. 1.416/1440, 'cause I need the fraction, the percentage. Windows 11 calc give me (standard and scientific, with no regard of F-E or not): 9.833333333333333e-4 Solution (again): Powershell.

PS C:\> 1.416/1440
0,000983333333333333

Or use calc from Windows NT 3.51, that behaviour was intruduced with NT 4.0 calc which behaves the same. Which makes this feature request over 25 years old... (Yes, I just booted up all my old VMs to test this - it is Saturday).

image

To make this even more crazy: calc.exe from Windows NT 3.51 works on Windows 11 64 bit. I did not expect that. Hats off to that amazing compatibility below the GUI.

image