iOS十进制切割格式转换
2016-04-14 19:58
513 查看
//@"123456789" 转换后 @"123,456,789"
@interface NSString (num) - (NSString *)money; @end @implementation NSString (num) - (NSString *)money{ NSNumberFormatter *numFormat = [[NSNumberFormatter alloc] init]; [numFormat setNumberStyle:NSNumberFormatterDecimalStyle]; NSNumber *num = [NSNumber numberWithDouble:[self doubleValue]]; return [numFormat stringFromNumber:num]; } @end
相关文章推荐
- iOS 隐藏多余的cell
- xCode5 在ios7模拟器中出现__cxa_throw _pthread_exit错误
- 判断设备通知是否开启
- iOS 开发新项目必要的准备
- iOS 获取手机型号,系统版本
- 苹果原生二维码在iOS7上的那些坑
- 奇葩问题
- iOS陆哥开发笔记(三十一) (应用性能调优的建议和技巧)
- iOS陆哥开发笔记(三十) (设计模式MVC、单例、代理、KVO)
- iOS陆哥开发笔记(二十九) (Autolayout(VFL)二)
- iOS开发.[NSBundle mainBundle] 通过pathForResource返回路径为空.
- iOS陆哥开发笔记(二十八) (Autolayout(VFL)一)
- iOS陆哥开发笔记(二十七) (同步、异步请求, GET、POST请求)
- iOS陆哥开发笔记(二十六) (NSIndexPath)
- iOS 开发 自定义 xibcell 重用
- 缓存之CoreData
- iOS陆哥开发笔记(二十五) (NSCoding)
- iOS 上常用的两个功能:点击屏幕和return退出隐藏键盘和解决虚拟键盘
- iOS开发:bitcode问题:linker command failed with exit code 1 (use -v to see invocation)
- iOS陆哥开发笔记(二十三) (缓存机制NSUserDefaults)