• 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: 5.2.3 Boolean Bugs?????
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 5.2.3 Boolean Bugs?????


  • Subject: Re: 5.2.3 Boolean Bugs?????
  • From: Robert Walker <email@hidden>
  • Date: Thu, 18 Mar 2004 00:59:42 -0500

I am using MySQL and the DECIMAL data type. That could explain the difference.

On Mar 17, 2004, at 3:30 PM, steve stout wrote:

What database are you using?  I'm using OpenBase.

.steve


On Mar 17, 2004, at 12:19 PM, Robert Walker wrote:

Interesting, I'm not seeing this behavior at all in 5.2.3. I have a BigDecimal (10, 2) and am using the formatter "0.##" and all seems fine. Whole number display correctly as "3" and decimals will correctly round to 2 digits like "3.15" for example.

On Mar 17, 2004, at 12:50 PM, steve stout wrote:

Yes, setting the ValueType to 'B' works and takes care of the ClassCastException, but the problem I'm having is that the scale of the BigDecimal isn't being set correctly. So, for example, if I have a whole number value like 3, the value that's returned comes out as 3.000000000. The default behavior of BigDecimal is to chop off those extra digits after the decimal. So somewhere in the instantiation of the BigDecimal, setScale() is being called. Unfortunately, just setting the scale in EOModeler doesn't work.

In 5.2.2, the solution was to set the ValueType to 'd', which would create a BigDecimal, but the scale would be set properly. This doesn't work in 5.2.3.

The reason why this is a problem is mainly for display purposes. If I have a value that uses a formatter of "0.##" because I _sometimes_ need to show the digits after the decimal, it will now always show the zeros. In 5.2.2, it would show "3" with a formatter of "0.##", but now that the scale is being set too high, it always shows "3.00"

I can't remember, but I think that this also causes a problem with comparing 2 BigDecimals. Because 3 != 3.000000000. I'll have to double check on this though.

.steve



On Mar 17, 2004, at 9:02 AM, Robert Walker wrote:

This behavior is again confirmed. I installed the 5.2.3 update on my test development box and found this problem.

This appears [SO FAR] to be a bug FIX not a new bug. I did not have the "B" value type set for my BigDecimal's in my model. WO 5.2.3 now throws the class cast exception, as it probably should have in 5.2.2. I could be wrong about this. However, adding the correct ValueType ("B" in this case) fixes the problem.

On Mar 17, 2004, at 8:40 AM, Travis Britt wrote:

On Mar 17, 2004, at 8:09 AM, Anders Peterson wrote:
I upgraded to WO 5.2.3 today on my Mac OS x 10.3.3 development machine.
I get ClassCastExceptions exceptions for (at least some) BigDecimals. I don't have Booleans.

I also see this behavior, after upgrading dev to 5.2.3.

I've got an EO with an attribute modeled as NSDecimalNumber, which maps to a FLOAT column in the DB. The code output by EOModeler casts this attribute to a BigDecimal, which throws the exception. Worked in 5.2.2.

tb
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.



--
Sincerely,
Robert Walker
Programmer
Bennett Technology Group
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.



--
Sincerely,
Robert Walker
Programmer
Bennett Technology Group
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.







///--------------------------------------- steve stout web coordinator arizona student unions 52o.626.o1o9

http://www.union.arizona.edu
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.



--
Sincerely,
Robert Walker
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: 5.2.3 Boolean Bugs?????
      • From: Chuck Hill <email@hidden>
References: 
 >5.2.3 Boolean Bugs????? (From: James Cicenia <email@hidden>)
 >Re: 5.2.3 Boolean Bugs????? (From: steve stout <email@hidden>)
 >Re: 5.2.3 Boolean Bugs????? (From: Anders Peterson <email@hidden>)
 >Re: 5.2.3 Boolean Bugs????? (From: Travis Britt <email@hidden>)
 >Re: 5.2.3 Boolean Bugs????? (From: Robert Walker <email@hidden>)
 >Re: 5.2.3 Boolean Bugs????? (From: steve stout <email@hidden>)
 >Re: 5.2.3 Boolean Bugs????? (From: Robert Walker <email@hidden>)
 >Re: 5.2.3 Boolean Bugs????? (From: steve stout <email@hidden>)

  • Prev by Date: Re: Losing my mind
  • Next by Date: [OT] Update Pulled?
  • Previous by thread: Re: 5.2.3 Boolean Bugs?????
  • Next by thread: Re: 5.2.3 Boolean Bugs?????
  • Index(es):
    • Date
    • Thread