Re: @sum and BigDecimal
Re: @sum and BigDecimal
- Subject: Re: @sum and BigDecimal
- From: Mike Schrag <email@hidden>
- Date: Mon, 12 Mar 2007 09:18:40 -0400
The problem lies in _NSUtilities.convertNumberIntoCompatibleValue
(Number, Class) method, and not in the @sum operator itself: if you
use a Number subclass that is not exactly an Integer, Long, Short,
Byte, BigInteger or BigDecimal, it build up a new BigDecimal
instance using the doubleValue() Number method... :-(
You mention that if you don't use a subclass that is (among others)
BigDecimal it does this ... It appears as I'm looking at this (well,
it WOULD appear if I looked at decompiled code, which I've stated
before, of course I don't do) that it does this specifically IF you
use a subclass that is BigDecimal. It seems to me that there's a
crucial check missing that if newValueType.isAssignableFrom
(value.getClass()) then it should just return the original value
without all the other fuss, which would deal w/ the case where you
ask to turn a BigDecimal into a BigDecimal.
ms
_______________________________________________
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