开发者

how to convert Float64 to NSString in iOS

How to 开发者_如何学JAVAconvert Float64 to NSString in objective-c?


How about this:

NSString *str = [NSString stringWithFormat: @"%lf", number];


You can also use

NSString *str = [[NSString alloc] initWithFormat: @"%lf", number];

Edit:

The difference is that you need to release the str variable in this case when you are done with it. We use init method to initialize class variables so that they can be accessible across the class and then release them in dealloc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜