I have a Double value:
double a = 4.5565;
What is the easiest way to calculate the number of digits after the decimal point (4 in this case
I think this might be a solution:
private static int getDecimalCount(double val) { int i=0; while (Math.Round(val, i) != val) i++; return i; } double val9 = 4.5565d; int count9 = getDecimalCount(val9);//result: 4
Sorry for the duplication -> https://stackoverflow.com/a/35238462/1266873