• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Accurate Money Values in Core Data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Accurate Money Values in Core Data
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: How to change the strings in application menu
  • Next by Date: Launching Application upon typing URL
  • Previous by thread: Re: Core Data and @count keypath
  • Next by thread: Re: Accurate Money Values in Core Data
  • Index(es):
    • Date
    • Thread