듀에코르다의 익스트림 네가티브

[Flash/Flex] ActionScript 3.0, byte size to human size. 9 개월 전

막상 필요해서 줏어다 쓰려니 소스들이 맘에 들지 않아서...

 

private function humanSize(fileSize:Number):String {
    var _index:Number = 0;
    while(fileSize > 1024) {
        fileSize = Number(fileSize / 1024);
        _index++;
    }
    return String(fileSize.toFixed(1)) + ["B","KB","MB","GB","TB"][_index]
}




가까운 글

Games
Junks
Search
Recent Articles
Recent Comments
Blogroll