Re: Recommendation for keeping track of money in Core Data
Re: Recommendation for keeping track of money in Core Data
- Subject: Re: Recommendation for keeping track of money in Core Data
- From: mmalcolm crawford <email@hidden>
- Date: Tue, 17 Jan 2006 05:27:29 -0800
On Jan 16, 2006, at 7:17 PM, Ryan Britton wrote:
Try this class. It guarantees a certain precision.
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/
ObjC_classic/Classes/NSDecimalNumber.html#//apple_ref/doc/uid/
20000179-BBCDBDHI
You can just archive/unarchive it to use it in core data.
To represent money, you should use the decimal attribute. There is
no need to archive/unarchive instances of NSDecimalNumber, the type
is supported natively:
<http://developer.apple.com/documentation/Cocoa/Reference/
CoreData_ObjC/Classes/NSAttributeDescription.html#//apple_ref/doc/
c_ref/NSDecimalAttributeType>
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden