NSString floatValue issue
NSString floatValue issue
- Subject: NSString floatValue issue
- From: "C Sandeep" <email@hidden>
- Date: Tue, 26 Feb 2008 12:55:46 -0500
Greetings,
I need to evaluate a NSString as a float value (represented by
NSNumber object). Here is my code snippet:
----
NSString *str = @"28/5";
NSNumber *nm = [NSNumber numberWithFloat:[str floatValue]];
NSLog(@"number: %@", nm );
----
this results in:
----
number: 28.0
----
However, I was expecting 5.6 as the result. How do I achieve this ? Thanks.
- Sandeep
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden