jbaird123
asked on
Java - how to convert "Double" to "Integer"
I have a variable of type "Double" (not "double") and I need to convert it to "Integer" (not "int"). Can someone tell me how to do this?
I have tried:
(Integer)MyDouble and I just get "Cannot cast from Double to Integer".
Also tried:
(int)MyDouble and got a similar error.
Please help.
I have tried:
(Integer)MyDouble and I just get "Cannot cast from Double to Integer".
Also tried:
(int)MyDouble and got a similar error.
Please help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That worked perfectly. Thank you!
Do you know of any good websites with this sort of information easily accessible? I need it from time to time and Googling this often just frustrates me.
Do you know of any good websites with this sort of information easily accessible? I need it from time to time and Googling this often just frustrates me.
That kind of thing could be slightly tricky to track down, given case problems etc. You can always ask here ;)
Open in new window