rderoldan1 / usagewatch_ext

Extended version of usagewatch
MIT License
21 stars 9 forks source link

mac.rb - mistake calculate #3

Closed chip-and-dail closed 10 years ago

chip-and-dail commented 10 years ago

In your file on function: ((used/total) * 100).round(2)

But right: ((total/used) * 100).round(2)

rderoldan1 commented 10 years ago

can you show me the line number?

chip-and-dail commented 10 years ago

63

rderoldan1 commented 10 years ago

Can you write an example, because I think is working properly, suppose you have a 500 GB HD and you are using 100 GB

2.1.2 :004 > ((100.0/500.0) * 100.0).round(2)
 => 20.0

So, I'm using 20% of my disk, but If I use your formula I'm using 500%?

2.1.2 :005 > ((500.0/100.0) * 100.0).round(2)
 => 500.0
chip-and-dail commented 10 years ago

Sorry, friend, it's my mistake... I must go to sleep =)

rderoldan1 commented 10 years ago

jaja, it is ok ;)