View Full Version : Help needed - number to %

12-12-2010, 11:49 AM
Hi All,

Im a total novice with coding other than html/css.

I have a video xml which, in which i need a new feature, could you help me with that?

Basically my video is being entered with a time of it - for example 30sec.

I have start and end trackers firing for the video but now i want to add impression trackers at 25%, 50%, 75%. I managed to do it using specifying seconds for the calls, but it becomes a pain to recalculate seconds for every video.

Any ideas I could follow?


Philip M
12-12-2010, 11:58 AM
Try this:-

<script type = "text/javascript">

var videotime = 30;
var t25 = Math.round(videotime *.25);
var t50 = Math.round(videotime *.5);
var t75 = Math.round(videotime *.75);


The avoidance of taxes is the only intellectual pursuit that carries any reward. - Anon