V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
alexrezit
V2EX  ›  iDev

MIT 开源 PRSizeFormatter

  •  
  •   alexrezit · 2013-12-17 11:08:36 +08:00 · 2487 次点击
    这是一个创建于 3986 天前的主题,其中的信息可能已经有所发展或是发生改变。
    Format sizes to human readable format.


    这个玩意儿是 Project Rhinestone 的副产品, 顺手把能支持的标准和格式都尽量支持了.


    Features

    * 2 standards: Decimal (1000), Binary (1024);
    * 9 prefixes: none, K, M, G, T, P, E, Z, Y;
    * 4 prefix types (expanded & abbreviated): Hybrid (used by Apple), Metric, JEDEC, IEC;
    * 2 base units (expanded & abbreviated): byte (B), bit (b);
    * Customizable available prefixes range;
    * Customizable abbrev cap;
    * Customizable number of digits after decimal point;
    * Customizable option for trimming trailing zeros after decimal point;
    * Customizable option for whether to use "Zero" to replace "0" when the size is 0.


    ref: https://github.com/AlexRezit/PRSizeFormatter
    1 条回复    1970-01-01 08:00:00 +08:00
    kevinzhow
        1
    kevinzhow  
       2013-12-17 11:57:35 +08:00
    Cool!
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2504 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 15:52 · PVG 23:52 · LAX 07:52 · JFK 10:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.