• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 97
  • Last Modified:

percentage remaining

We put engines on the planes, Each engine has time_since_new - eg 22538 (in hours)

We also have a customer profile that we say that for this customer the life limit hours is 50000 ( hours)
Now I want to calculate the percentage time remaining

I do 50000 minus 22538 and then get the percentage? Help appreciated.
0
anumoses
Asked:
anumoses
  • 3
  • 2
3 Solutions
 
Bill BachPresidentCommented:
(TotalLife - UsedLife) / TotalLife * 100%, or (50000 - 22538)/50000 * 100%.
0
 
anumosesAuthor Commented:
((life_limit_hours/percent_time_remaining)*100) as answer_percent

As you mentioned this seems correct
0
 
anumosesAuthor Commented:
select round((50000 - 22538)/50000 * 100,2) from dual

I get 54.92 percent remaining
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
awed1Commented:
1- [Current hours (22538)/Total hours(50000)]=%of hours remaining.
1-.45076 = .54924 which is 54.924% rounds to 55%
0
 
Bill BachPresidentCommented:
Exactly.  If you didn't want the value as a percentage, simply eliminate the *100 and you'll be left with a decimal value.
0
 
anumosesAuthor Commented:
Thanks
1

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now