How many bytes is it This time, we want render the count of bytes in a human readable way to user. Let's write a program (a full one or a function or other acceptable formats) to do this.

Input

An non-negative integer, in range \$0\leq n&lt;2^{31}\$, which means n bytes.

Output

A string, the human friendly representation of n bytes.

Convention


If n is less than 1000, add B after n and output; otherwise...
Convert to a number less than 1000, plus one of these units: KiB, MiB, GiB; round the number to 3 figures
For more details of conversion, check out these testcases


Testcases

0 -&gt; 0B
1 -&gt; 1B
42 -&gt; 42B
999 -&gt; 999B
1000 -&gt; 0.98KiB
1024 -&gt; 1.00KiB
2018 -&gt; 1.97KiB
10086 -&gt; 9.85KiB
100010 -&gt; 97.7KiB
456789 -&gt; 446KiB
20080705 -&gt; 19.2MiB
954437177 -&gt; 910MiB
1084587701 -&gt; 1.01GiB
1207959551 -&gt; 1.12GiB
2147483647 -&gt; 2.00GiB


Rules


This is code-golf, so shortest bytes win
Standard loopholes forbidden
You should output exactly the same to the testcase:


No white space or other symbols between number and units;
Use KiB, not KB, kib, or kb;
Leading or trailing white spaces are optional
JavaScript (ES6), 78 74 bytes



f=(n,i)=&gt;n&lt;999.5?i?n.toPrecision(n&lt;1^3)+' KMG'[i]+'iB':n+'B':f(n/1024,-~i)
&lt;input oninput=o.textContent=f(this.value)&gt;&lt;pre id=o&gt;




Edit: Saved 4 bytes thanks to @Arnauld.