Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Numbervar and number of decimals

Status
Not open for further replies.

chris35

Technical User
Apr 21, 2003
24
0
0
US
I am using CR9 and am calculating a turn around time and then diplaying it in Hrs & Mins.

Here is the formula:
datetimevar CDT:={View.CallbackDateODBC}+{View.CallbackTimeODBC};
datetimevar PDT:={View.PhoneDateODBC}+{View.PhoneTimeODBC};
numbervar callphone:= DateDiff ("n",CDT,PDT);

if callphone <=60 then totext(callphone) & "m"
else int(callphone/60) & "h" & "" & remainder(callphone,60) & "m"

This displays the results with 2 decimal places. Forgive my ignorance, but I can't figure out how to strip the deciamls and display the Hrs and Mins in whole numbers.

Thanks for any help.
 
Try:

datetimevar CDT:={View.CallbackDateODBC}+{View.CallbackTimeODBC};
datetimevar PDT:={View.PhoneDateODBC}+{View.PhoneTimeODBC};
numbervar callphone:= DateDiff ("n",CDT,PDT);

if callphone <=60 then totext(callphone,0,"") & "m"
else totext(int(callphone/60),0,"") & "h" & " " & totext(remainder(callphone,60),0,"") & "m"

-LB
 
Thanks LB, that did the trick!

CL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top