mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 10:58:57 +00:00
parent
d69a9d52a9
commit
238476bfcd
@ -205,8 +205,8 @@ function unitPrefixed(input, binary) {
|
|||||||
if (input === undefined || isNaN(input)) {
|
if (input === undefined || isNaN(input)) {
|
||||||
return '0 ';
|
return '0 ';
|
||||||
}
|
}
|
||||||
factor = 1000;
|
var factor = 1000;
|
||||||
i = '';
|
var i = '';
|
||||||
if (binary) {
|
if (binary) {
|
||||||
factor = 1024;
|
factor = 1024;
|
||||||
i = 'i'
|
i = 'i'
|
||||||
@ -237,10 +237,14 @@ function unitPrefixed(input, binary) {
|
|||||||
}
|
}
|
||||||
if (input > factor) {
|
if (input > factor) {
|
||||||
input /= factor;
|
input /= factor;
|
||||||
if (binary && input >= 1000) {
|
var prefix = ' k';
|
||||||
return input.toLocaleString(undefined, {maximumFractionDigits: 0}) + ' k' + i;
|
if (binary) {
|
||||||
|
prefix = ' K';
|
||||||
}
|
}
|
||||||
return input.toLocaleString(undefined, {maximumSignificantDigits: 3}) + ' k' + i;
|
if (binary && input >= 1000) {
|
||||||
|
return input.toLocaleString(undefined, {maximumFractionDigits: 0}) + prefix + i;
|
||||||
|
}
|
||||||
|
return input.toLocaleString(undefined, {maximumSignificantDigits: 3}) + prefix + i;
|
||||||
}
|
}
|
||||||
return Math.round(input).toLocaleString() + ' ';
|
return Math.round(input).toLocaleString() + ' ';
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user