#PHP4.1, 63 62 bytes
PHP4.1, 63 62 bytes
Not the best golfing, but surely is quite short.
<?for($S=kMG;$B>1e3;$I++)$B/=1e3;printf("%.1f{$S[$I-1]}B",$B);
To use it, access over POST/GET or set a value in the SESSION, on the key B
.
Leave the key I
unset!