How to convert 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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With