converting decimals into times

# Thread: converting decimals into times

1. Senior Member
Join Date
Dec 1969
Posts
1,212

## converting decimals into times

Hey all,<BR><BR>I was talking to Craig and Whassup about something related to this earlier - but trust me, it&#039;s not a repost! Now, I&#039;m not a programmer by training, but I&#039;m trying to learn, so please be gentle with me if my methods make you wanna vomit... ;-)<BR><BR>I had a bit of code which used the FSO to look up the file size of a given file. I then did a few basic arithmetical thingies to express the time it would take to download these files over a 56k connection.<BR><BR>The steps I took were these:<BR><BR>Set fs=Server.CreateObject("Scripting.FileSystemObject ")<BR>f=fs.GetFile("C:file.pdf") &#039;find the file<BR>s=f.size &#039;returns the file size in bytes<BR><BR>filebits=(s*8) &#039;Turn the file size into bits<BR><BR><BR>Now I was able to divide filebits by 56000 and then by 60 to get the number of minutes, expressed as a decimal, that the file would take to download.<BR><BR>That&#039;s all fine - but is there a sensible way to express this decimal in real time so that I can say "this file is Xkb and will take about 1 min 34 seconds to download over a 56k connection"?<BR><BR>I achieved this in a REALLY crappy way before, but ran into a hitch that basically told me that my way only worked in a very specific set of circumstances (ie. was horrifically shite).<BR><BR>Help!<BR><BR>R

2. Senior Member
Join Date
Dec 1969
Posts
16,931

## RE: converting decimals into times

You can use MOD to work it all out. Check the documentation on the left.<BR><BR>Craig.

3. Senior Member
Join Date
Dec 1969
Posts
1,212

## RE: converting decimals into times

cheers Craig

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•