On Aug 15, 2008, at 2:07 PM, Florijan Stamenkovic wrote:
However, I am not sure I should actually store the extra precision. In our situation, we would store the value in some currency *as it is on the invoice*, and then at runtime possibly calculate it into other currencies, but would not store the result. So, unless there are currencies that per se require more then 2 precision digits, we gain nothing by extra precision on the db layer. See my point?
I wasn't even thinking about the actual conversion rate, more just what if the base unit of an item is < .01?
In my application, we have parts that are used to make other parts. One example part is Tape. It comes in a very long role - several hundred feet, but we use it by the inch. Now that role is only a few dollars and when you divide it by the number of inches, you get a decimal much smaller than 2 places - which becomes zero if we don't store enough decimal places. We use over 60 inches total in making a master case. If the cost-per-inch were zero, then my cost for 60 inches would be zero also, which isn't exactly the value the Accountant was looking for.
I've found that storing 6 decimal places in the DB is sufficient (so far).
Dave _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
