-2

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)?

Splilz
  • 1
  • 1

1 Answers1

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