Spotlight calculation results

Hello all,


I use the spotlight a lot for calculations, and dividing a big number gives me many decimals. I tried to find how to change this to show only two decimals, but I didn't find a solution. Is there any way to change it?


I use Sonoma

MacBook Pro (M2 Max, 2023)

Posted on Nov 14, 2023 3:04 PM

Reply
Question marked as Top-ranking reply

Posted on Nov 15, 2023 3:22 AM

Maybe it's easier to use Calculator, as dialabrain said.


There is a somewhat cumbersome method using Spotlight, though.

You can round a result using "round", e.g.


round(7/3)

yields the result 2.

Ideally, you should be able to use round with a second parameter to indicate the number of decimals, but that doesn't work.

A little math, though, provides a solution. Suppose you want a big division, rounded to two decimals after the period. This rounds it to an integer:



So, multiply by 100 before rounding, and then divide by 100:


4 replies
Question marked as Top-ranking reply

Nov 15, 2023 3:22 AM in response to EkLekTos

Maybe it's easier to use Calculator, as dialabrain said.


There is a somewhat cumbersome method using Spotlight, though.

You can round a result using "round", e.g.


round(7/3)

yields the result 2.

Ideally, you should be able to use round with a second parameter to indicate the number of decimals, but that doesn't work.

A little math, though, provides a solution. Suppose you want a big division, rounded to two decimals after the period. This rounds it to an integer:



So, multiply by 100 before rounding, and then divide by 100:


Nov 15, 2023 1:02 PM in response to EkLekTos

I do simple and quick calculations. That’s why I use the spotlight. The only way I can think of fixing it is with the terminal code because there is no setting for decimals. But I need to find a way to do it. 


I can use the terminal for calculations, and I can set how many decimals I want, but it is not so advanced for my calculations to always use the terminal. Btw thank you guys for your help

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Spotlight calculation results

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.