I want to write code that finds the number of digits after the decimal in a
double number. This is what I'm currently doing:
double d;...
...String doubleString = Double.toString(d);
int digitsAfterDecimal = doubleString.length() - doubleString.indexOf('.') - 1;
But when the double reaches a certain point the double goes into scientific notation. How can I get the number of digits even when the string goes into scientific notation? Is there a better way besides using a string?