Thread View: aus.computers.java
3 messages
3 total messages
Started by Livio Colbertaldo
Fri, 20 Oct 2000 00:00
help with converting a double to an integer
Author: Livio Colbertaldo
Date: Fri, 20 Oct 2000 00:00
Date: Fri, 20 Oct 2000 00:00
4 lines
849 bytes
849 bytes
I have a Double Variable A which I need converted to an integer... ive tried to use intValue() which is part of the double class but I dont think im gettin the syntax right ne help would b appreciated
Re: help with converting a double to an integer
Author: Benjamin Johnston
Date: Fri, 20 Oct 2000 00:00
Date: Fri, 20 Oct 2000 00:00
14 lines
1098 bytes
1098 bytes
> I have a Double Variable A which I need converted to an integer... > ive tried to use intValue() which is part of the double class > but I dont think im gettin the syntax right > ne help would b appreciated This probably summarizes everything... Integer converted = new Integer(new Double(3.5).intValue()); int converted2 = (int)3.5; -Benjamin Johnston s355171@student.uq.edu.au
Re: help with converting a double to an integer
Author: Paul Murray
Date: Sat, 21 Oct 2000 00:00
Date: Sat, 21 Oct 2000 00:00
11 lines
1037 bytes
1037 bytes
> I have a Double Variable A which I need converted to an integer... An int, or a java.lang.Integer? int x = A.intValue(); or Integer x = new Integer(A.intValue()); -------------------------------------------------------------- Repent! Quit your job! Slack off! http://www.users.bigpond.com/pmurray
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads