I'm implementing the Comparator interface to compare two numeric values against each other. The values come in as a string consisting of 13 characters (ex: 2000102400001). I need to convert this string into a numeric value for comparison. Problem is the numeric formats I've tried(integer, long) throw a compile error "out of range". Any clues? Thanks in advance. Dmitry
jason adam
Chicken Farmer ()
Ranch Hand
Joined: May 08, 2001
Posts: 1932
posted
0
Check out the API for BigInteger, I'm sure you will find everything you need in there Jason
Bosun Bello
Ranch Hand
Joined: Nov 06, 2000
Posts: 1506
posted
0
Use parseLong. Remember to enclose it within try/catch and catch NumberFormatException long yourNum = Long.parseLong(yourString)
Bosun
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.