On Aug 15, 2008, at 11:38 AM, Florijan Stamenkovic wrote:

Hi all,

I am using BigDecimal in combination with WO for the first time, and have some questions, perhaps someone with experience could explain.

1. Is the scale of the resulting BigDecimal based on the scale of the property as defined in the model?

Yes, I believe so. I use them all the time and I only run into problems if I'm doing a math function where the result ends up with too many decimal places. I then have to scale it manually before assigning it to the attribute otherwise I get an exception. I've thought about putting the scale function directly into the generated setter method, but I haven't gone there yet.


2. Why does the currencyAmount wonder prototype has the scale of 4, instead of 2? Easy to deal with, I am just wondering if there is a specific reason for that...

How currency-centric of you. If you are selling widgets that are really small, or you have a very strong currency, you may want to keep track of a cost that is < .01 for calculations, even if the value presented to the customer ends up getting rounded to 2 decimal points. With some currencies you don't even need decimal points. Colombian Peso, USD, etc.

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]

Reply via email to