Hi! I`ve got an assignment wich causes me to find out if a number is a decimal or not, in short. So I+m thinkingof converting a double number to integer and see if the number changes. But I can`t get the conversion right, what am I doing wrong here ?
Getting the error : double cannot be dereferenced. Is what I`m trying to do possible, is it the best way of doing it? Thanks
Originally posted by Haakon Lind: Hi! I`ve got an assignment wich causes me to find out if a number is a decimal or not, in short.
Try getting the value as a String, then parse it using StringTokenizer for the decimal point. Just a suggestion.
Joined: Sep 18, 2002
Thanks Ron, I actually didn`t know that variables are primitive, i thought only direct input of char, int, double etc. was primitive. My Idea should work out now as it gave me what I expected. Thanks for input Anthony, but think that will require one or two more lines of code Thanks!