Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 180
  • Last Modified:

mathmatic

Hi Iam working on internet cafe project(prepaid)  Ihave 2 editboxes named value (number)  and period (time)  Iwant full  function to count the period from value .
0
sraab2004
Asked:
sraab2004
  • 3
1 Solution
 
MotazCommented:
What do u mean by period, and what is value??
please give example of data and the output you want, example:

value = 50
period (time) = 10 hours or (time) = '12:23 pm'

Motaz
0
 
kretzschmarCommented:
just to agree with motaz, give a result-sample
0
 
MotazCommented:
If I understand u, suppose that value is the money, and period is the time payed for that amount of money, and 1$ = 1 hour (60 minutes) of time, then the function could be:

function GetPeriod(Value: Double): Integer;
begin
  Result:= Round(Value * 60);
end;

example

  edPeriod.Text:= IntToStr(GetPeriod(StrToFloat(edValue.Text)));

Motaz
0
 
MotazCommented:
I forget to mention that the result is minutes, for example

if you enter 1 you will get 60 minutes
2 = 120 minutes, and so on

Motaz
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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