<script>
 export let size;

 const units = [
     "o",
     "kio",
     "Mio",
     "Gio",
     "Tio",
     "Pio",
     "Eio",
     "Zio",
     "Yio",
 ]
 function formatSize(input) {
     var res = input;
     var unit = 0;
     while (res > 1024) {
	 unit += 1;
	 res = res / 1024;
     }
     return (Math.round(res * 100) / 100) + " " + units[unit];
 }
</script>

<span title="{size} octets">
    {formatSize(size)}
</span>
