Click here to Skip to main content
11,410,750 members (63,470 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C C#
hi, how to calculate Amount based on Number of hours?

for example:

some X(hours)= Y(price),

thanx in advance..
Posted 30-May-12 21:17pm
Rajesh Kariyavula at 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 at 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 at 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 at 31-May-12 2:45am
yes exactly...
Rate this: bad
Please Sign up or sign in to vote.

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: bad
Please Sign up or sign in to vote.

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[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 8,920
1 OriginalGriff 6,918
2 Maciej Los 3,390
3 Abhinav S 3,248
4 Peter Leow 3,059

Advertise | Privacy | Mobile
Web02 | 2.8.150414.5 | Last Updated 31 May 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100