1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 23:20:51 +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) { _formatBitrate: function (bits) {
if (typeof bits !== 'number') { if (typeof bits !== 'number') {
return ''; 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) { if (Bs >= 1000000) {
return (bits / 1000000).toFixed(2) + ' Mbit/s'; return (Bs / 1000000).toFixed(2) + ' MB/s';
} }
if (bits >= 1000) { if (Bs >= 1000) {
return (bits / 1000).toFixed(2) + ' kbit/s'; return (Bs / 1000).toFixed(2) + ' KB/s';
} }
return bits + ' bit/s'; return Bs + ' B/s';
}, },
_formatTime: function (seconds) { _formatTime: function (seconds) {