Re: Array controllers in code?
Re: Array controllers in code?
- Subject: Re: Array controllers in code?
- From: Chris Hanson <email@hidden>
- Date: Fri, 23 Jul 2010 04:01:20 -0700
On Jul 22, 2010, at 1:15 PM, Quincey Morris <email@hidden> wrote:
> Incidentally, if you're dealing with currency, it's better to use integers (the number of cents, rather than the number of dollars, essentially) rather than floating point.
Actually, the OP has said that her data model has these attributes as decimal; this means the values will be instances of NSDecimalNumber.
This is correct, and is how you should generally work with currency values in Cocoa (rather than as integers) because it allows you control over rounding behavior, which can be very important in financial calculations.
NSDecimalNumber also has calculation methods to use, so the OP doesn't need to use +-*/%, but rather the equivalent methods on NSDecimalNumber instances.
-- Chris
_______________________________________________
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