Why not use the java.util.Number class instead? 
Who cares if it's an Integer or a Double if all
we do is comparing?

Frank Sauer

-----Original Message-----
From: Mark A. Belonga [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 19, 2001 12:14 PM
To: jaxen
Subject: [Jaxen] number()


All,

Currently, number( value ) will convert the value to a Double only if it is
already a Double or if it is a string with a decimal place. If it has no
decimal place, it will convert value to an Integer.

This causes problems when you do something like:

    number( '4' ) < number( '12.0' )  (same for '>' as well).

Which causes a ClassCastException since we're using compareTo (see Integer
javadocs).

I suggest that number ALWAYS converts to a Double. Does anyone disagree? Is
there any reason we would *not* want to convert to Double?

-Mark




_______________________________________________
Jaxen-interest mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jaxen-interest

_______________________________________________
Jaxen-interest mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jaxen-interest

Reply via email to