1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 15:09:14 +00:00

[file upload] use 'B' instead of 'bit' for showing progress

This commit is contained in:
llj
2013-08-03 16:36:30 +08:00
parent 7519bb9c20
commit 5eeb8e3cb1

View File

@@ -328,17 +328,20 @@
_formatBitrate: function (bits) {
if (typeof bits !== 'number') {
return '';
} else {
var Bs = bits / 8;
}
if (bits >= 1000000000) {
return (bits / 1000000000).toFixed(2) + ' Gbit/s';
if (Bs >= 1000000000) {
return (Bs / 1000000000).toFixed(2) + ' GB/s';
}
if (bits >= 1000000) {
return (bits / 1000000).toFixed(2) + ' Mbit/s';
if (Bs >= 1000000) {
return (Bs / 1000000).toFixed(2) + ' MB/s';
}
if (bits >= 1000) {
return (bits / 1000).toFixed(2) + ' kbit/s';
if (Bs >= 1000) {
return (Bs / 1000).toFixed(2) + ' KB/s';
}
return bits + ' bit/s';
return Bs + ' B/s';
},
_formatTime: function (seconds) {