12,551,121 members (48,780 online)
Rate this:
See more:
hi, how to calculate Amount based on Number of hours?
suppose

for example:

some X(hours)= Y(price),
2X=price?
3X=Price?
.....
.....
24Hours=Price?
.....
3Days=Price?
.....
.....
10days=Price?

Posted 30-May-12 20:17pm
Rajesh Kariyavula 31-May-12 2:21am

Price is defined for an hour or a day? Do you want to derive a formula for this?
sandeep nagabhairava 31-May-12 2:28am

for example 1-3 hours 15rs,1-6 hours 30rs,1-12 hours 45rs.... yes i want formula for this, if u know plz help me..
Rajesh Kariyavula 31-May-12 2:41am

I suppose that you will be entering a time and you want to get amount based on the rules you have set like 1-3 hours 15rs,1-6 hours 30rs,1-12 hours 45rs. Is it correct?
sandeep nagabhairava 31-May-12 2:45am

yes exactly...

Rate this:

## Solution 2

Try this logic:

```decimal _duration = 3; //the input time
decimal price = 15; //As I noticed there is 15/- raise on doubling hours.

decimal Amount = (_duration / 3) * price;```

Hope this helps.
Tell me if I got you wrong. I'll correct it.
Rate this:

## Solution 1

Hi Sandeep,
I think you want to calculate salary on the basis of hours if so, this link might help you-
salary-calculation on basis of hours[^]

Top Experts
Last 24hrsThis month
 Suvendu Shekhar Giri 95 Dave Kreskowiak 50 Harpreet05Kaur 40 Mehdi Gholam 35 ppolymorphe 35
 OriginalGriff 3,911 Suvendu Shekhar Giri 1,838 John Simmons / outlaw programmer 1,687 ppolymorphe 1,581 Karthik Bangalore 1,210