• 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
Re: BigDecimal, scale, and prototypes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BigDecimal, scale, and prototypes


  • Subject: Re: BigDecimal, scale, and prototypes
  • From: David Avendasora <email@hidden>
  • Date: Fri, 15 Aug 2008 14:42:21 -0400


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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >BigDecimal, scale, and prototypes (From: Florijan Stamenkovic <email@hidden>)
 >Re: BigDecimal, scale, and prototypes (From: David Avendasora <email@hidden>)
 >Re: BigDecimal, scale, and prototypes (From: Florijan Stamenkovic <email@hidden>)

  • Prev by Date: Re: BigDecimal, scale, and prototypes
  • Next by Date: Re: WOBuilder substitute for Eclipse 3.3+ in Leopard
  • Previous by thread: Re: BigDecimal, scale, and prototypes
  • Next by thread: Entity Modeler Attribute prefix woes...
  • Index(es):
    • Date
    • Thread