On Sat, Jan 17, 2009 at 11:41 PM, Richard Dammkoehler <r...@noradltd.com> wrote:
> NSDecimalNumber *num = [[NSDecimalNumber alloc] initWithString:"23.30"];

1) That's not an ObjC string, it's a C string.  That will crash unless
you replace it with @"23.30".
2) If the current locale isn't one that uses a period as the decimal
separator, that is not a valid number.
3) You are invoking the parser to convert hard-coded digits into an
NSDecimalNumber instance.  Why not just provide the number directly,
avoiding the parser altogether?  It's a constant, there's no need to
make the framework do more interpretation on it than necessary.

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to