123456789101112131415161718192021222324252627 |
- //
- // NSNumber+YHExpanded.m
- // YouHuiProject
- //
- // Created by 小花 on 2018/5/29.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "NSNumber+YHExpanded.h"
- @implementation NSNumber (YHExpanded)
- - (NSString *)getStringNumber:(NSInteger)number{
- NSString *str=[self stringValue];
- if (number==0||str.length>=number) {
- return str;
- }
- NSMutableString *mStr=[NSMutableString stringWithString:str];
- for (NSUInteger i=mStr.length; i<number; i++) {
- [mStr insertString:@"0" atIndex:0];
- }
- return mStr;
- }
- @end
|