[Calculator]Missing percentage [%] button

Bug #1518284 reported by Jeremie Tamburini
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Ubuntu Calculator App
Incomplete
Undecided
Unassigned
Ubuntu UX
Triaged
Low
James Mulholland

Bug Description

The percentage [%] button is missing.

Calculator got very nice advanced functions but every time there is the need to calculate a discount, a commission, VAT, etc.. with the Ubuntu Phone it takes longer than using any other cheap calculator.

Could you please add this basic but very common function?

Thanks :)

Tags: needs-design
Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Hi Jeremie,
thanks for your feedback :-)

We drop the % button due a designers' request, so I add the UI team to the bug to have their feedback

Changed in ubuntu-calculator-app:
status: New → Incomplete
summary: - Missing percentage [%] button
+ [Calculator]Missing percentage [%] button
tags: added: needs-design
Changed in ubuntu-ux:
status: New → Triaged
importance: Undecided → Low
assignee: nobody → James Mulholland (jamesjosephmulholland)
Revision history for this message
Antoine Motte dit Falisse (antoinemotteditfalisse) wrote :

Maybe you can replace the X³ because there is a X^ available, it's a bit redundant.

There is a weird priority accorded to very specific and rare functions (like Mod, or e^n) : It's a pocket calculator, it's mainly to do quick and daily maths... like a percent reduction on something ;-)

People who actually use e^n or mod functions use probably something more powerful and adapted to scientific maths...

Revision history for this message
Jeremie Tamburini (jeremie2) wrote :

At least I have found a workaround.

It seems that every calculator developers hate [%] buttons. I couldn't find any alternative in the Ubuntu Store. In the meantime parenthesis stopped to work on Calculator (Bug #1616270), making things worse.
Today I found a temporary solution.
What should we use in the end of 2016 on a smartphone to calculate percentage? Yes.. the beautiful.. the only one.. the magnificent Terminal!

I wrote 3 python's script and set 3 aliases in the ~/.bashrc
(I'm not a code developer, I'm not an expert. There are probably hundred ways to do something better, but this is what I can do with my basic skills).

If someone is interested:

1. Make sure the Terminal (and maybe also the File Manager) is installed on your Ubuntu phone/tablet.

2. With a text editor create the 3 scripts:

perc.py
Copy/paste the following text: https://paste.ubuntu.com/23390226/ and save the file.

perc_minus.py
Copy/paste the following text: https://paste.ubuntu.com/23390232/ and save the file.

perc_plus.py
Copy/paste the following text: https://paste.ubuntu.com/23390236/ and save the file.

3. Save the 3 files into the Documents folder on your Ubuntu Phone.

4. Set 3 aliases in the ~/.bashrc.
This is probably not one of the best practice, but at least it's a good way to use super short commands into the smartphone's shell.
If you find difficult to write with Nano editor on your smartphone, just use the file manager to find the hidden file .bashrc in your home directory and copy/paste it in another folder, for instance into Documents (do also a backup copy). You will be able to reach this file from your computer.
Add the following lines after the "# some more ls aliases" rules:

# python percentage
alias p='~/Documents/perc.py'
alias pm='~/Documents/perc_minus.py'
alias pp='~/Documents/perc_plus.py'

Aliases should not be shell metacharacters or name of command of other programs ("pp" will not work on the desktop). I choose p, pm, pp as easy and logical way to remember the action of the commands and an easy way to write it on the smartphone command line (see below). You can choose the aliases you prefer.

Then copy/paste the .bashrc file in the original folder.

5. If the terminal was open, close it and restart it.

HOW IT WORKS
The 3 examples:

- "SIMPLE" PERCENTAGE, like 200 x 5%. Run the command:
p 200 5
It will display: 200 x 5% = 10

- PERCENT REDUCTION, like 136,78 - 25%. Run the command:
pm 136,78 25
It will display: 136,78 - 25% = 102,58500000000001

- PERCENT INCREASE, like 180.05 + 43%. Run the command:
pp 180.05 43
It will display: 180.05 + 43% = 257,4715

If you don't use the syntax [alias] [total-number] [percentage-number], the command will return an error.
As you can see float numbers can be written with commas ',' or dots '.' it doesn't make any difference.

Revision history for this message
Jeremie Tamburini (jeremie2) wrote :

Sorry, just forgot on step 3. after the 3 files have been saved into the Documents folder, they need the executable permission.
Open the terminal and run these 2 commands:

cd Documents

chmod +x perc.py perc_minus.py perc_plus.py

Revision history for this message
Jeremie Tamburini (jeremie2) wrote :

Last time I'm bothering with the workaround.

Just to say that I have created a page on the Italian Ubuntu wiki http://wiki.ubuntu-it.org/UbuntuPhone/RisoluzioneProblemi/PercentualeCalcolatrice which will be kept up to date (possibly improved) till a better solution will arrive.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.