Accurate Money Values in Core Data
Accurate Money Values in Core Data
- Subject: Accurate Money Values in Core Data
- From: Steve Cronin <email@hidden>
- Date: Tue, 7 Feb 2006 01:54:14 -0600
Folks;
It seems that the collective wisdom is:
1) Use the Decimal attribute type in the data model
2) Use NSDecimalNumber when performing calculations
So assuming 'extendedCost' is a Decimal attribute what does CoreData
do with the following:
[[[[self mutableSetValueForKey:@"lineItems"] allObjects]
valueForKeyPath:@"@sum.extendedCost"]
What NSDecimalNumberHandler is Core Data using for this? [And by
extension @avg]
Is it using NSDecimalNumber compliant arithmetic?
Does it use NSDecimalNumber compliant arithmetic in all cases or is
the arithmetic dependent on the data type?
Did I miss some documentation on this matter somewhere?
Is there a good listing of best practices on money handling in
CoreData or in Cocoa?
Thanks!
Steve
_______________________________________________
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