From 3c24e6924351c1c8fb086c0152c82f63a3e6aeea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guillaume=20Perr=C3=A9al?= <guillaume.perreal@irstea.fr>
Date: Thu, 22 Jan 2015 16:29:39 +0100
Subject: [PATCH] =?UTF-8?q?Am=C3=A9liore=20la=20pr=C3=A9cision=20de=20la?=
 =?UTF-8?q?=20barre=20d'upload.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 Resources/js/widget/file_upload.js | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/Resources/js/widget/file_upload.js b/Resources/js/widget/file_upload.js
index 8c421ab3..ba1795a3 100644
--- a/Resources/js/widget/file_upload.js
+++ b/Resources/js/widget/file_upload.js
@@ -123,11 +123,12 @@
                     if(!data.context || e.isDefaultPrevented()) {
                         return;
                     }
-                    var progress = Math.floor(data.loaded / data.total * 100);
+                    var percent = data.loaded / data.total * 100,
+                        percentText = percent.toFixed(1);
                     data.context.each(function () {
-                        $this.find('.progress').show().attr('aria-valuenow', progress);
-                        $this.find('.progress-bar').css('width', progress + '%');
-                        $this.find('.progress-text').show().html(progress + '% ('+formatBitrate(data.bitrate)+')');
+                        $this.find('.progress').show().attr('aria-valuenow', percentText);
+                        $this.find('.progress-bar').css('width', percent + '%');
+                        $this.find('.progress-text').show().html(percentText + '% ('+formatBitrate(data.bitrate)+')');
                     });
                 }
             }
-- 
GitLab