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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rounding time in crystal report

Status
Not open for further replies.

susanna123

Technical User
Jan 22, 2010
79
CA
Attempting to round time to 2 decimal places. The result of formula gives value:

(58:59 when rounding to 2 decimal places, but when rounding to 4 - 57:59, the value is correct)

Formula is:

totext(abs({procRptIndProdUserModuleTime;1.TotalTime} / 3600),"00") & ":" &
totext(abs(remainder({procRptIndProdUserModuleTime;1.TotalTime},3600) / 60),"00") & ":" &
totext(abs(remainder(remainder({procRptIndProdUserModuleTime;1.TotalTime},3600),60)),"00");

Any help is appreciated.
Thks.
 
Your question is not clear. What do you mean by rounding to 2 and 4 decimal places. Decimals do not appear to come into any of your calculations.

Your formula to display HH:MM:SS looks fine.

Ian
 
Rounding is best done using the Round command. Time is best displayed using ToText, your Help function should give you the options.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top