From 1dd3be2266c65f97985437efb47aeb21d9358300 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 15 Apr 2011 16:46:06 +0200 Subject: Zahlenrundung beim Download angepasst --- application/modules/fbgui/views/scripts/index/start.phtml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'application/modules/fbgui/views/scripts/index/start.phtml') diff --git a/application/modules/fbgui/views/scripts/index/start.phtml b/application/modules/fbgui/views/scripts/index/start.phtml index 2e78fb2..9b48fbf 100644 --- a/application/modules/fbgui/views/scripts/index/start.phtml +++ b/application/modules/fbgui/views/scripts/index/start.phtml @@ -108,12 +108,18 @@ function bytesToSize(bytes) { return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[[i]]; } +if (!Number.toFixed) { + Number.prototype.toFixed=function(n){ + return Math.round(this*Math.pow(10, n)) / Math.pow(10, n); + } +} + function updateProgress(p, s, u){ $("#progressbar").progressbar({ value: ((actFile-1)*33+(p/3))}); if (p >= 0 && p <= 100){ $(".progressbar:last").progressbar({ value: p }); - $(".downloadelement .status:last").html("Downloading... "+p+"% - "+parseInt(s)+" "+u); + $(".downloadelement .status:last").html("Downloading... "+p+"% - "+(s.toFixed(2))+" "+u); }else{ $(".progressbar:last").progressbar({ value: 0 }); } -- cgit v1.2.3-55-g7522