我没有设备价格格式设置。
NSNumber *temp = [NSNumber numberWithDouble:dblPrice];
NSDecimalNumber *someAmount = [NSDecimalNumber decimalNumberWithDecimal:[temp decimalValue]];
NSNumberFormatter *currencyFormatter = [[[NSNumberFormatter alloc] init] autorelease];
[currencyFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
return [currencyFormatter stringFromNumber:someAmount];
如何获取短日期设置?
答案 0 :(得分:14)
NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
[dateFormatter setDateStyle:NSDateFormatterShortStyle];
NSString *dateString = [dateFormatter stringFromDate:[NSDate date]];