Scale byte values by smkt

main(S){char s[]={0,'K','M'};float p;while(~scanf("%f",&p)){S=0;while(p>1023)p/=1024,S++;printf(S?"%0.2f %cB\n":"%.0f\n",p,s[S]);}}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page