mirror of https://github.com/rancher/ui.git
Fix unit of local storage
This commit is contained in:
parent
911ed210ce
commit
f4ace8b1cc
|
|
@ -145,7 +145,7 @@ var Host = Resource.extend({
|
|||
|
||||
localStorageBlurb: Ember.computed('localStorageMb', function() {
|
||||
if (this.get('localStorageMb')) {
|
||||
return formatSi(this.get('localStorageMb'), 1024, 'iB', 'B');
|
||||
return formatSi(this.get('localStorageMb'), 1024, 'iB', 'B', 2 /*start at 1024^2==MB */);
|
||||
}
|
||||
}),
|
||||
|
||||
|
|
|
|||
|
|
@ -242,11 +242,11 @@ export function formatKbps(value) {
|
|||
return formatSi(value*1000, 1000, "bps", "Bps");
|
||||
}
|
||||
|
||||
export function formatSi(inValue, increment=1000, suffix="", firstSuffix=null)
|
||||
export function formatSi(inValue, increment=1000, suffix="", firstSuffix=null, startingExponent=0)
|
||||
{
|
||||
var units = ['B','K','M','G','T','P'];
|
||||
var val = inValue;
|
||||
var exp = 0;
|
||||
var exp = startingExponent;
|
||||
while ( val >= increment && exp+1 < units.length )
|
||||
{
|
||||
val = val/increment;
|
||||
|
|
|
|||
Loading…
Reference in New Issue