diff --git a/scripts/eepromv1a.js/bytefmt.js b/scripts/eepromv1a.js/bytefmt.js index a051293..dc5f3f8 100644 --- a/scripts/eepromv1a.js/bytefmt.js +++ b/scripts/eepromv1a.js/bytefmt.js @@ -1,12 +1,12 @@ const EEPFMT = (() => { const symbols = ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y', 'R', 'Q']; - const format = (bytes, binary) => { + const format = (bytes, decimal) => { if(bytes === 0) return 'Zero Bytes'; const negative = bytes < 0; - const power = binary ? 1024 : 1000; + const power = decimal ? 1000 : 1024; const exp = Math.floor(Math.log(bytes) / Math.log(power)); bytes = Math.abs(bytes); @@ -31,7 +31,7 @@ const EEPFMT = (() => { if(number > 1) string += 's'; } else { - if(binary) + if(!decimal) string += 'i'; string += 'B'; } diff --git a/scripts/eepromv1a.js/main.js b/scripts/eepromv1a.js/main.js index db4d1cd..caf6dc0 100644 --- a/scripts/eepromv1a.js/main.js +++ b/scripts/eepromv1a.js/main.js @@ -105,7 +105,7 @@ const EEPROM = function(appId, endPoint, auth) { toString: () => 'EEPROM app is not configured properly.', }; if(result.status === 413) { - const maxSize = parseInt(xhr.headers().get('x-eeprom-max-size')); + const maxSize = parseInt(result.headers().get('x-eeprom-max-size')); const maxSizeFormatted = EEPFMT.format(maxSize); throw { error: 'eeprom:size_error',