C (gcc), 108 102 bytes
Works as Yimin Rong suggests.
f(float i){char*a="GiMiKi"+6;while(i>=999.5)i/=1024,a-=2;printf("%.*f%.2sB",*a&i<100?i<10?2:1:0,i,a);}
Unglofed
f(float i){
char*a="GiMiKi"+6;
while(i>999i>=999.5)
i/=1024,a-=2;
printf("%.*f%.2sB",*a&i<100?i<10?2:1:0,i,a);
}
C (gcc), 108 101 99 bytes
Works as O.O.Balance suggests.
f(float i){char*a="GiMiKi"+6;while(i>999)i/=1024,a-=2;printf("%.*f%.2sB",*a&i<100?i<10?2:1:0,i,a);}
Unglofed
f(float i){
char*a="GiMiKi"+6;
while(i>999)
i/=1024,a-=2;
printf("%.*f%.2sB",*a&i<100?i<10?2:1:0,i,a);
}