Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Percetange calculation wrong result

I want to calculate the percentage of a minute from a given number of hours.
So let’s say I have 2 hours. That’s 2*60 minutes.
And I want to know how much percent does 1 minute take from 2 hours.
The value should be 0.833, because 0.833 * (2*60) = 100%.
But how do I get this 0.833 number?

(hours * 60) / 100 gets me 1.2 when hours=2, not 0.833

It’s a simple question I know, but I just cannot figure out why my percentage is not right.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The formula should be 1 minute / total minutes. So for 2 hrs, its 1 min / 120 min = 0.00833 which is 0.833%.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading