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

Impromptu time formating

Status
Not open for further replies.

john1968

MIS
Joined
Nov 19, 2002
Messages
2
Location
GB
Hi can anyone help me witha time formating problem?
I have a data field which come out in seconds. ie 300 = FIVE MINUTES. How can I convert this in Impromptu to show as minutes and seconds. ie 330 to show as 5:30 five minute thirty seconds. At the moment we are getting 5.5 five point five minutes.
Cheers
 
John
Try this as a calculated field:
(number-to-string-padded(floor(time/60),2)) + 'Minutes & ' + (number-to-string-padded (floor(time - (floor(time/60)*60)),2)) + ' Seconds'

(or use just n-t-s function if you don't want zeros)

Note that N-T-S-P is an impromptu function, while floor is both Imp and DB.

HTH,
lex
 
Cheers drlex,
what about if I want to sum these numbers up?
As in one days data and then looking at the whole
week. Will this format allow it?
 
john,
Just create a calculation in the same format, but obviously you'll have to amend the numbers (and strings) to suit the format required - e.g."/3600" for hours or "/86400" for days.
Lex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top