For example if I had a (double 123.987) how can take what comes after the right of the decimal and make it A integer (987)?
Asked
Active
Viewed 30 times
1 Answers
0
Well you can use String and split to derive your output:
double number = 123.456;
String numberString = String.valueOf(number);
String[] digits2 = numberString.split("\\.");
System.out.println(digits2[1]);
After having this output, you can cast it to integer. Should not be that hard

Asgar
- 1,920
- 2
- 8
- 17