var oneMB = 1024 * 1024;
var oneGB = 1024 * oneMB;
var oneKB = 1024;
export function formatFileSize(size) {
    if (size === Infinity) {
        return null;
    }
    var formattedSize = size;
    var unit = 'B';
    if (size >= oneGB) {
        formattedSize = size / oneGB;
        unit = 'G';
    }
    else if (size >= oneMB) {
        formattedSize = size / oneMB;
        unit = 'M';
    }
    else if (size >= oneKB) {
        formattedSize = size / oneKB;
        unit = 'K';
    }
    return "" + formattedSize + unit;
}
