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: Jeff LaMarche <email@hidden>
- Date: Mon, 16 Jan 2006 21:33:42 -0500
On Jan 16, 2006, at 8:37 PM, Mike Zornek wrote:
Does anyone have any advice on the best column type to use to
handle money
in a Core Data Application.
Longer term I'd like it to be an international app as well, and be
able to
store money based on system preferences.
Well, it seems that you have three options: float, double, and
decimal number.
The only difference between float and double is the precision. For
money, in many cases both double and decimal are going to use more
storage than you would ever use unless you're dealing with
extraordinarily large numbers or are storing fractions of a cent.
It's going to depend on what your needs are. If you're doing personal
finance program, float is probably fine; if you're doing budgetary
accounting for a country, you'd probably want to lean toward double
or even decimal number.
For most situations where you need to deal with money, I'm guessing
float is going to be fine. 32 bits of precision if your mantissa is
only 2 should be plenty for most applications.
_______________________________________________
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