Tuesday, July 22, 2008

Converting a double to an int in Java

Today I needed to do something rather simple like converting a double (which will always be an int by practice) to an int. I did a search and found this page

and it gave me exactly what I needed. I have a String value which is stored as a number in oracle, but comes out of the BO with decimals.

Here's the code I ended up with:


Not very pretty, but it does what I need.

No comments: